Interoperability - PInvoke

Interoperability - PInvoke

  
P/Invoke is the process used to access native Win32 API calls within the .NET Framework. One of the hard parts of using P/Invoke is determining the method signature you need to use; this can often be an exercise in trial and error. Sending incorrect data types or values to an unmanaged API can often result in memory leaks or other unexpected results.

I've wasted a lot of time trying to discover the best way of using some win32 APIs and i believe this site can help us a lot: http://www.pinvoke.net/

PInvoke.NET is a wiki that can be used to document the correct P/Invoke signatures to be used when calling unmanaged Win32 APIs. A wiki is a collaborative Web site that anyone can edit, which means there are thousands of signatures, examples, and notes about using P/Invoke. Since the wiki can be edited by anyone, you can contribute as well as make use of the information there.

Check PInvoke.NET site, it will save you a lot of time.....

Cheers
F.