Pat O
Pat O

Reputation: 1374

What are the troubleshooting steps/tools for C# to Native interop?

I have an SDK that is written primarily in C#. We have some native code that was written for security and performance reasons. We use DllImport to interop with the native code. There are a few functions that I get an "Unable to find an entry point named '...' in DLL '...'.":"" error. I have verified that the function that is not found is exported. I have verified that it does not have a mangled name. I have verified that the parameters line up. I have tried a couple different calling conventions in the DllImport attribute. I guess I can keep trying this sort of randomly, but I am hoping there is a more direct approach.

Does anyone know of a tool or method to get more information in a case like this? How confident should I be that the dll has been located? Would I get this exception if the parameters are wrong? Any help would be appreciated.

Pat O

Upvotes: 2

Views: 256

Answers (3)

Bryan
Bryan

Reputation: 2791

Not if this works in the Full Framework or not, but you can try:

http://blogs.msdn.com/stevenpr/archive/2005/06/22/431612.aspx

Upvotes: 1

Christopher Karper
Christopher Karper

Reputation: 583

I use dumpbin to get my list of exports...

Good luck!

Upvotes: 0

C. Ross
C. Ross

Reputation: 31878

I use Dependency Walker to find the exported functions in a C++ DLL. This will help ensure you're trying to import the right name, etc.

Upvotes: 0

Related Questions