Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

Yesterday, I tried to load the third party dll of my device to C# using PIO calls .. like DLLIMPORT command. Whenever I run the application, build failed because of Loading the dll failed. I thought that, that given dll was corrupted.

In the next, I thought that wants to load from VC++ using __stdCall command. There I got a message as zlib1.dll is not able to refer ..

I am not getting a similar kind of error message in C# / VS 2008 IDE ? Please suggest me the related settings to my IDE.

Thanks & Regards,
Kota V Subrahmanyam,
CMC Ltd, Hyderabad.
Posted
Comments
Ryan Zahra 28-Jan-11 5:08am    
Could you post the error message that you got both from the C++ and C# environments?

1 solution

You need to check the documentation for the dll to make sure your DLLImport attributes are correct. This has nothing to do with VS 2008 IDE as the dll is only referenced when you actually run your program. Make sure the DLL is also accessible either in the same directory as the exe file or in one of the directories accessible via the PATH environment variable.
 
Share this answer
 
Comments
SKOTAJI 28-Jan-11 7:34am    
Thanks Richard for your immediate reply. As you said, documentation should specify those dependencies. Finally I am able to run the application by placing those two DLLs from BIN directory. But here my doubt is why this VS 2008 is not able to tell the dependency dll error ? Why from VC++ - VS 6.0 ?
Richard MacCutchan 28-Jan-11 8:40am    
As I said before, Visual Studio does not check DLL dependencies for C# since the library is only referenced at run time. The actual mechanism is similar to the Win32 LoadLibrary() method, where the library is not linked to the project when it is built.

SKOTAJI 3-Feb-11 6:13am    
I am clear now. Thanx Richard.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900