Hi,
I'm trying to use a C function ( long int myFunc() ) from a DLL in my
C# program. I use DllImport("dllname") a C function and declare it as
[DllImport("dllname")]
public static extern int myFunc();
At first I used
public static extern long myFunc();
but that returned a bizarre value. I incorrectly assumed a C long int
mapped
to C# long. Using C# int worked. But here's my question -
Since the DLL is known, is there a tool that will list the C#
equivalents for
the functions as long as the variable types are standard (i.e., int,
long, float, etc. )? Does it seems reasonable that C# should be able
to gather this info from the DLL?
Finally, what is the name of the process of using the [DllImport...]
specification for loading external functions?
Is this PInvoke?
Are there any books/articles describing this in detail, particularly
with
accessing and running C functions that return pointers to structures.
Thanks,
Ted