Is there a tool that generates P/Invoke signatures for arbitrary unmanaged DLL?

GregC picture GregC · Jun 12, 2011 · Viewed 20k times · Source

I stumbled upon a tool that generates P/Invoke signatures for Microsoft's own unmanaged DLLs: PInvoke Interop Assistant

Is there a similar tool that will generate P/Invoke signatures for third-party unmanaged DLLs?

Alternately, any way to feed a third-party DLL to PInvoke Interop Assistant

EDIT: Actual issue I am trying to resolve

Answer

Ben Voigt picture Ben Voigt · Jun 12, 2011

Google quickly found http://www.pinvoker.com/ (Compatiblity listed as VS2005, 2008, and 2010; it doesn't seem to have been updated to work with newer versions)

Microsoft's C++/CLI compiler can also do this, if you use /clr:safe and #include the header file, it will generate p/invoke code which you can extract with e.g. ILSpy (free) or Red Gate Reflector (used to be free).