Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

(again) unable to load DLL run-time error


  • Please log in to reply
9 replies to this topic

#1 sunbelt57

sunbelt57
  • Members
  • 10 posts

Posted 04 March 2011 - 05:51 PM

(sorry for the double post - my keyboard is kinda touchy) anyway: I get this run-time error when running LJDotNetEx.cs Unable to load DLL 'ljackuw.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) It occurs at the call to Labjack.ListAll() I'm compiling using VS2005 in C# and under Solution Explorer I have refs to LJACKUWXLib and LJDotNet. There was originally just LJDotNet in the refs for the netest project. When I got the run-time error, I stopped it, went to the COM tab of the add reference dialog and picked the listing that said 'ljackuwx ActiveX Control Module'. After that the LJACKUWXlib showed in the references of sol. exp. and I get the same rt error. I tried looking threw the previous posts and found some related topics. I'll keep looking. Thanks, Dan

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 07 March 2011 - 12:29 PM

Have you gone through steps 1-3 of the quickstart:

http://labjack.com/support/u12

This will make sure the driver is installed and the hardware is ready.

#3 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 07 March 2011 - 04:34 PM

(sorry for the double post - my keyboard is kinda touchy)

anyway:
I get this run-time error when running LJDotNetEx.cs
Unable to load DLL 'ljackuw.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

It occurs at the call to Labjack.ListAll()

I'm compiling using VS2005 in C# and under Solution Explorer I have refs to LJACKUWXLib and LJDotNet. There was originally just LJDotNet in the refs for the netest project. When I got the run-time error, I stopped it, went to the COM tab of the add reference dialog and picked the listing that said 'ljackuwx ActiveX Control Module'. After that the LJACKUWXlib showed in the references of sol. exp. and I get the same rt error.
I tried looking threw the previous posts and found some related topics. I'll keep looking.

Thanks,
Dan


You shouldn't need to use the ActiveX stuff at all for anything with .NET. THe LJDotNet reference should be enough.

Is this a 64-bit version of windows? If you've already gone through the normal U12 setup here and things still aren't working, then you may need to install the 64-bit version of the LJackUW.dll which is listed on that support page. If you haven't gone through that setup yet than it will probably fix the issue.

On 64-bit machines sometimes .NET will compile into a 64-bit application which then requires the 64-bit .dll.

#4 sunbelt57

sunbelt57
  • Members
  • 10 posts

Posted 08 March 2011 - 04:47 AM

Here's what I did: 1) downloaded the 64 bit dll and lib files - when I tried to copy them to the c:\windows\system32 directory it wouldn't let me over right the current ljackuw.dll with the 64 bit version of ljackuw.dll 2) I looked in the processes and services tabs of taskmanager to see if there was something running that had the dll file open - (nothing called labjack or lj***) 3) then I did a google search on 'how to unload a dll' - I found something that said use regedit to edit the HKEY_LOCAL_MACHINE Software Microsoft Windows CurrentVersion Explorer AlwaysUnloadDll (not there - must be different for Windows 7 - couldn't find any entry related to unloading dlls or open files) 4) I did another google search (I actually use startpage) and found some info on Vista but I have to go to work now so I'll report back later...

#5 sunbelt57

sunbelt57
  • Members
  • 10 posts

Posted 08 March 2011 - 05:00 AM

nevermind all that, I restarted my file manager as administrator and it was able to copy over the 32 bit version of the dll (I saved a backup of it). Hopefully it will work now.

#6 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 08 March 2011 - 03:58 PM

Sometimes when you are unable to copy over a file like that it's also a permissions error (particularly in Vista and Windows 7). You basically need to start a copy of windows explorer with admin rights so it can copy/remove/replace files.

#7 sunbelt57

sunbelt57
  • Members
  • 10 posts

Posted 03 July 2011 - 05:23 PM

still having problems: I ran ljtest.exe and found the driver version was lower than V1.17 so I uninstalled the legacy driver in control panel->uninstall and rebooted. Then I downloaded the 64-bit U12 drivers to c:\windows\system32. Then I downloaded the U12SetupV121.exe and ran it and got the message: "Cannot register "C:\windows\sytem32\ljackuwx.ocx" Is there some utility that I have to run that will unregister the previous ocx? Just for fun, I started visual studio and loaded the LJDotNetEx project and right-clicked on 'References' in the Solution Explorer and tried the 'Add Reference' dialog and couldn't find any .NET or COM Labjack component that was registered before I uninstalled it. Now I can even run the legacy C++ apps.

#8 sunbelt57

sunbelt57
  • Members
  • 10 posts

Posted 03 July 2011 - 05:43 PM

Well I tried copying the 32-bit version of ljackuw.lib ljackuw.dll and ljackuwx.ocx to windows\system32 and the C++ app works but the LJtest.exe shows the Driver Version as V1.210. I copied the latest C# nettest.sln and and compiles OK but when I try to run, it stops at the ListAll function with a DllNotFoundException was unhandled error: "Unable to load DLL 'ljackuw.dll The specified module cound not be found."

#9 sunbelt57

sunbelt57
  • Members
  • 10 posts

Posted 04 July 2011 - 11:15 AM

I found a good article on the error msg: 'BadImageFormatException' which is a little misleading. The guy in the article says it took him 2 days to trace the problem down. He recommended downloading some tools from www.sysinternals.com called processmonitor.exe and processexplorer.exe. As it turns out my problem was that I didn't have ljackuw.dll (64bit) in the bin\debug directory of the C# example. He goes into other problems that can cause that error msg.

http://connect.micro...sult-0x8007000b

Happy 4th!

#10 nielsenmike

nielsenmike
  • Members
  • 1 posts

Posted 15 January 2014 - 02:32 PM

I was struggling with a similar can't find .dll error in vb.net. The link above is broken but in desperation I searched 'BadImageFormatException' and "two days" and it held the solution. The article says he toggled the build target from "any" to "x86" and back and it worked. Tried that but it didn't work for me, however just changing it to "x86" did! Hope this helps someone else as much as it did me - thanks!


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users