tags:

views:

465

answers:

4

I am writing in C#.
How can i find out which methods/functions I can use in an unmanaged dll that doesn't belong to windows?
Exmaple : I have some installed software on my computer, it has a dll, and i want to know what my options are as to creating code to connect to that software?

+1  A: 

PInvoke.net is great resource for .NET interop. They list not only the functions available in Windows native libraries, but also the signature you need to use in your .NET code.

Brian Sullivan
Does pinvoke.net include dlls not in win32?
Will
I think there are other unmanaged APIs on there, but I'm not sure which ones.
Brian Sullivan
+3  A: 

For native DLL's that you do not have a reference for you can use the dumpbin utility in the Visual Studio SDK to extract the list of exported functions in a DLL.

Dumpbin reference is here: http://msdn.microsoft.com/en-us/library/c1h23y6c(VS.71).aspx

And a CodeProject page giving some additional details on how to use dumpbin in conjunction with finding the correct P/Invoke signatures is here: http://www.codeproject.com/KB/mcpp/usingcppdll.aspx#Retrieve

Joe Kuemerle
+1  A: 

use Depends.exe (which comes along with VS).

Depends would display all the exported function that can be invoked from Managed code using Pinvoke.

Naveen
A: 

I read a blog about PInvoke Interop Assistant, which can deal with our own DLLs as well http://www.codeplex.com/clrinterop/Release/ProjectReleases.aspx?ReleaseId=14120

GregUzelac