Can't find PInvoke DLL exception

L

Lcubed

My WM5 C# application was working with a native DLL I created. Then I
needed to change the name of the DLL. Everything compiled properly,
but when I try to run my app with the renamed DLL, there is a "Can't
find PInvoke DLL" exception with no further information. I've followed
the steps to enable interop logging(http://blogs.msdn.com/stevenpr/
archive/2005/06/22/431612.aspx), but no file is created.

I've even tried generating a new project and copying the functions to
the new project with the same result.

Does anyone have any ideas on what I could be overlooking?

Thanks!
 
D

DrewCE

Make sure the DLL is in the search path - same folder as your executable, or
in the Windows folder, etc.

You can also get this error when one of the dependencies of the target DLL
can't be found.

-Drew
 
L

Lcubed

Hi Drew,

Thanks for the input! My DLL is in the same directory as my executable
and the new DLL does not have any dependencies that the old one didn't
have. I only changed the name of the DLL. Is there any sort of
registration process that must be done in WM5?

Thanks!
Lcubed
 
L

Lcubed

Hi Drew,

Thanks for the input! I did end up finding one dependent DLL that the
target DLL was not finding even though both the target DLL and the
dependent DLL are in the same directory as the executable. I'm still
not sure why the dependant DLL cannot be found as neither it nor the
code calling it changed.

Thanks!
Lcubed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top