Home | Resume | Blog Brian Ensink's Blog | Platform Invoke Signatures

Platform Invoke Signatures

by Brian Ensink 14. September 2009 23:15

Just about every .NET developer will eventually need to call some magic Windows function to do something that just isn’t exposed by the .NET framework. Often the hardest part of invoking a platform function from C# or VB.NET is figuring out the signature and structure declarations to pass to the unmanaged API. There are two resources I use to make this process less painful.

First is the public wiki at http://pinvoke.net/. This website contains PInvoke signatures for thousands of Win32 platform functions contributed by the community at large. The quality is across the spectrum but generally good and because its a wiki you can fix mistakes, add new signatures and samples.  I’ve contributed a few minor things myself although I can’t remember exactly what anymore.

The second resource is the open source PInvoke Interop Assistant. This very useful tool lets you copy and paste function and structure declarations directly from Windows header files and automatically generates the PInvoke signatures. It even has a command line version that generates interop signatures for an entire header file in one step.

While neither of these resources is 100% foolproof they have been enough to get me through every time I’ve needed to PInvoke something.

Tags:

Software Development

Comments

11/30/2009 6:26:45 PM #

payday loans

Like your writing! Still you can do some things to improve it.

payday loans |

Comments are closed

About the author

I am currently a .NET developer and really enjoy the platform.  .NET seems to be able to take the developer whereever he/she wants to go.  To the desktop, to the web, to a database, etc.  At my day job I write desktop apps but I also like to toy with other tech as I have time.