P/Invoke explanation

  • Thread starter Thread starter Jeroen
  • Start date Start date
J

Jeroen

Hi all,

On more than one occasion I stumbled upon an explanation here that
talks about the 'P/Invoke layer'. Although I've got a general idea
what it's about, I'm having trouble grasping what it really means.
Because I suspect I'm not the only one with these questions, here they
are on a single, new newsgroup thread:

- Can someone define what the "P/Invoke layer" is/means?
- Are there any good introductory (!) articles on this subject?

Thanks, regards,
Jeroen
 
    P/Invoke (short for platform invoke) is a term used to describe calling
functions exported from DLLs (native code, and not COM objects, that's COM
interop).

And u cant use them calling java programs... please tell me I´m wrong.
looking for just that
 
Hi,


Did you google it?
I just enter P/invoke and the two first article are a good source of help.

In short P/Invoke is the feature in .NET that allows you to call unmanaged
(native WIN32) code.
 
What, call native DLL functions from Java programs? I don't believe
that is the case. I believe that you can make calls to native DLLs through
JNI.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

P/Invoke (short for platform invoke) is a term used to describe calling
functions exported from DLLs (native code, and not COM objects, that's COM
interop).

And u cant use them calling java programs... please tell me I´m wrong.
looking for just that
 
Nicholas Paldino said:
What, call native DLL functions from Java programs? I don't believe
that is the case. I believe that you can make calls to native DLLs
through JNI.

He said calling Java programs... presumably calling Java from .NET.

I know that with the Microsoft VM every Java class becomes a COM component,
so you could use COM interop. Though that's not likely to work with any
other VM, such as Sun.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

P/Invoke (short for platform invoke) is a term used to describe calling
functions exported from DLLs (native code, and not COM objects, that's
COM
interop).

And u cant use them calling java programs... please tell me I´m wrong.
looking for just that
 
And u cant use them calling java programs... please tell me I´m wrong.
looking for just that

True.

..NET--(P/Invoke)--C--(JNI)--Java

or one of the other work arounds.

If you are willing to stretch things a bit, then http://www.ikvm.net/ !

Then you can actually run Java code within .NET - I may not want
to have an important project depend on it, but just for fun I tried
using it to call the Oracle thin JDBC driver from C# - it worked
fine.

Arne
 
I read christery as going the other way, C# -> Java. There is probably a way
with CORBA, but I usually just wrap the java codes as an app with an
input/output file API.

Nicholas Paldino said:
What, call native DLL functions from Java programs? I don't believe
that is the case. I believe that you can make calls to native DLLs through
JNI.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

P/Invoke (short for platform invoke) is a term used to describe calling
functions exported from DLLs (native code, and not COM objects, that's COM
interop).

And u cant use them calling java programs... please tell me I´m wrong.
looking for just that
 
Back
Top