Dll Not Found in IDE


Author: Dave
Date: 12.31.10 - 4:35pm



If you are getting the error DLL not found when using a standard C Dll or maybe if a dependancy of the dll is not being found either in the IDE or at runtime, you can do a manual LoadLibrary() call and it will fix it.

This error can also be caused by the dll failing to load. You can test this by if LoadLibrary(explicitpath.dll) = 0. This happened to me tonight and cost me many many hours debugging. A popular version of zlib was failing to load on versions of windows prior to XPSP2 because it tried to import kernel32.DecodePointer. Ouch. VB6 IDE really sucks when it comes to loading declares

If you are working on the C dll, also make sure to store the handle returned by the LoadLibrary call and issue a FreeLibrary(hLib) in termination. If you dont, the IDE will hang onto the dll itself, and you will have to close the IDE to recompile the C dll.

It appears this problem stems from a bug in VB6 IDE where it doesnt always set the applications current working directory properly on launch. Maybe I was launching the project from a shortcut or something when I was having this problem mostly. Also when you create a new project and start working on it after saving it to a directory it doesnt reset. Another solution to this problem is to issue a chdir app.path in the form load to explicitly set the working directory in case the vb6 is using something else.




Comments: (0)

 
Leave Comment:
Name:
Email: (not shown)
Message: (Required)
Math Question: 90 + 16 = ? followed by the letter: N 



About Me
More Blogs
Main Site
Posts: (All)
2024 ( 1 )
2023 ( 9 )
2022 ( 4 )
2021 ( 2 )
2020 ( 4 )
2019 ( 5 )
2018 ( 6 )
2017 ( 6 )
2016 ( 22 )
2015 ( 15 )
2014 ( 25 )
2013 ( 4 )
2012 ( 10 )
2011 ( 7 )
2010 (11)
     Dll Not Found in IDE
     Advanced MSScript Control
     random tip
     Clipart / Vector Art
     VB6 Callback from C#
     Binary data from VB6 to C#
     CSharp and MsScriptControl
     HexDumper functions
     Js Beautify From VB6 or C#
     vb6 FormPos
     Inline Asm w VB6
2009 (3)
     The .NET Fiasco
     One rub on computers
     Universal extractor