[RESOLVED] "File not found", run-time error 53
This is starting to bug me, really.
I've searched these forums for 3 days, but found no answer, I've googled 'till my eyes bled but still I haven't found a solution...
In a project I'm currently working on I need the ability to compress files, so I decided to use BZIP2 compression as I've used it before and it works well, so to save some time I simply copied the code from a previous project;
Code:
Private Declare Function z2Compress Lib "libbz2.dll" Alias "BZ2_bzBuffToBuffCompress" (Dest As Any, destLen As Long, Source As Any, ByVal sourceLen As Long, ByVal blockSize100k As Long, ByVal Verbosity As Long, ByVal workFactor As Long) As Long
Now, this DLL-file, libbz2.dll is compiled using VC++ from the latest BZIP2 source (1.0.4), and works just fine in the other project.
However, whenever I attempt to use the "z2Compress" function in this project I get a "Run-time error 53: File not found: libbz2.dll", and this file is located in the same folder as the project files.
It works just fine though, if I statically declare the path to the file:
Code:
Private Declare Function z2Compress Lib "c:\my_project\libbz2.dll" Alias "BZ2_bzBuffToBuffCompress" (Dest As Any, destLen As Long, Source As Any, ByVal sourceLen As Long, ByVal blockSize100k As Long, ByVal Verbosity As Long, ByVal workFactor As Long) As Long
Though that is out of the question, once compiled, this project is not not meant to run from a static path, it's supposed to be able to run from where ever.
I'm losing my mind over this...any ideas on why it can't find the file?
I'd really, REALLY appreciate some help on this.
Re: "File not found", run-time error 53
Welcome to the Forums
Register the dll with regsvr32
Re: "File not found", run-time error 53
Thanks for the reply, but...
The DLL can't be registered, and as said, it works in another VB6 project.
"[...]libbz2.dll was loaded, but the DLLRegisterServer entry point was not found
This file can not be registered."
Re: "File not found", run-time error 53
I dont see where that was stated but if you cant register the dll then it should be looking in the app.path first when its not registered.
You are working this in the ide but if you compile a test exe will it work? Also, the dll is located in the vbp's project directory?
Re: "File not found", run-time error 53
Hmm...that was interested indeed, and thanks for pointing it out.
The DLL is indeed found when the project is compiled and run, strange enough...
I never though of even trying that as I understand the IDE is supposed to be the same thing, only using more debugging features.
Re: "File not found", run-time error 53
Well when you have a project saved in some folder, that folder becomes the app.path and the dll will need to reside in there. If you havent saved the project yet then the path will be located in the "C:\Program Files\Microsoft Visual Studio\VB98" path where you need to add the dll too.