3 Replies - 948 Views - Last Post: 01 September 2015 - 12:48 PM Rate Topic: -----

#1 Khatana   User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 45
  • Joined: 07-December 13

Unable to load DLL, the specified module couldn't be found.

Posted 29 August 2015 - 11:00 AM

Unable to load DLL, the specified module couldn't be found. (Exception from HRESULT: 0x8007007E)

Hello,
I'v Visual studio 2013 Professional with update-4.
I have a DLL library, written in Visual C++ and compiled in Visual studio 2012.

I wrote a wrapper (DLLImport attribute) to call native c++ dll function through my C# methods. I have also installed Visual C++ redistributable for visual studio 2013. I have also placed C++ DLL file in current working directory (debug directory)...
but even all doing above, I'm unable to load C++ dll file through my code ...
Please help me. Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Unable to load DLL, the specified module couldn't be found.

#2 andrewsw   User is offline

  • Bouncy!
  • member icon

Reputation: 6563
  • View blog
  • Posts: 26,615
  • Joined: 12-December 12

Re: Unable to load DLL, the specified module couldn't be found.

Posted 29 August 2015 - 11:32 AM

For anyone reading there is additional information for the same question posted at SO.
Was This Post Helpful? 1
  • +
  • -

#3 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6291
  • View blog
  • Posts: 21,620
  • Joined: 05-May 12

Re: Unable to load DLL, the specified module couldn't be found.

Posted 29 August 2015 - 08:31 PM

Show us your code.

If you could also put your sa_api.dll into a ZIP file and attach it, that would help us try to diagnose the issue. If you have the source code for that DLL, even better if you could also point us to the source and/or have another ZIP file for the source.

Also in the StackOverflow comment, you said that you used dependency walker, but it wasn't clear to us if you had resolved all the dependency errors.

Another thing to consider is: Is the C++ DLL compiled for 64 or 32 bit? Is your C# assembly compiled accordingly?
Was This Post Helpful? 1
  • +
  • -

#4 Khatana   User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 45
  • Joined: 07-December 13

Re: Unable to load DLL, the specified module couldn't be found.

Posted 01 September 2015 - 12:48 PM

Thanks all, problem was. I was using incorrect version of dll file. I must use 32 bit version, but I was using 64bit dll. Thanks for time and giving valuable knowledge.

This post has been edited by Khatana: 01 September 2015 - 12:50 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1