Top "Pinvoke" questions

P/Invoke is an implementation specification created by Microsoft of the Common Language Infrastructure (CLI) for invocation of native code libraries from managed code.

Marshaling pointer to an array of strings

I am having some trouble marshaling a pointer to an array of strings. It looks harmless like this: typedef struct { …

c# pinvoke unmanaged marshalling
How to call CreateProcess() with STARTUPINFOEX from C# and re-parent the child

I need to create a new process but so that it is a "child" of another process not the current …

c# .net pinvoke createprocess reparenting
Automatically creating C# wrappers from c headers?

Is there a way to automatically create p/invoke wrappers for .net from a c header? Of course I could …

c# .net c interop pinvoke
Changing a C# delegate's calling convention to CDECL

I have had this problem with C# when I was using DotNet1.1 The problem is this. I have an unmanaged …

c# c++ interop pinvoke calling-convention
P/Invoke or C++/CLI for wrapping a C library

Have a moderate size (40-odd function) C API that needs to be called from a C# project. The functions logically …

c# .net c++-cli pinvoke
DllImport and char*

I have a method I want to import from a DLL and it has a signature of: BOOL GetDriveLetter(OUT …

c# .net pinvoke marshalling dllimport
Is the class NativeMethods handled specially in .NET?

https://msdn.microsoft.com/en-us/library/ms182161.aspx Are the three classes described on this paged handled specially in the .…

c# .net pinvoke native-methods
Correct way to marshal SIZE_T*?

I have the following C++ function definition, which I am trying to call through PInvoke from managed code: bool FooBar(…

c# c++ pinvoke marshalling intptr
C# P/Invoke: Marshalling structures containing function pointers

Sorry for the verbose introduction that follows. I need insight from someone knowing P/Invoke internals better than I do. …

c# pinvoke marshalling structure function-pointers
Serial Communication with Silverlight 5 (COM port)

I'm working on an ASP.NET website in which I'll need to access an usb device from the client side. …

asp.net serial-port pinvoke device silverlight-5.0