Look at "interop" in the .NET documentation (attribute
Calling a C++ function is just like calling the Windows API.
For instance:
[DllImport("kernel32.dll", EntryPoint = "LoadLibraryW", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Winapi)]
private static extern IntPtr LoadLibrary(string fileName);
[DllImport("kernel32.dll", EntryPoint = "FreeLibrary", CallingConvention = CallingConvention.Winapi)]
private static extern IntPtr FreeLibrary(IntPtr hModule);
[DllImport("kernel32.dll", CharSet=CharSet.Ansi, ExactSpelling=true, SetLastError=true, CallingConvention=CallingConvention.Winapi)]
internal static extern IntPtr GetProcAddress(IntPtr hModule, string procName );
[DllImport("ole32.dll", CallingConvention=CallingConvention.StdCall)]
static extern void CoFreeUnusedLibrariesEx(int msUnloadDelay, int MustBeZero);
I think
void *
can be translated to
IntPtr
.
Hope this helps,
Pablo.