Fog Creek Software
Discussion Board

Welcome! and rules

Joel on Software

Need help with PInvoke

I am struggling with a custom win32 dll. I have managed to get all DllImorts right; the problem now is the excact same code works in one .Net project, but fails in another. Both projects are Web Forms, their virtual folders are created and configured identically under the same parent virtual folder.

If I cut'n paste the offending code from my second project into the first, it works!

I have no clue what so ever on how the dll is implemented, threading model or anything.

Do any of you have any ideas on where to go from here? Please?

Thomas Eyde
Sunday, February 1, 2004

Never mind. I solved it. The dll I am calling is calling other dlls, the current directory is \bin, and the dll folder is not in the path environment variable.

Set current directory to dll folder, or better, add the dll folder to path.

It's strange that .Net/PInvoke does not have a function for that.

Thomas Eyde
Monday, February 2, 2004

*  Recent Topics

*  Fog Creek Home