-
Nov 3rd, 2007, 10:42 AM
#1
Thread Starter
New Member
[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.
-
Nov 3rd, 2007, 10:44 AM
#2
Re: "File not found", run-time error 53
Welcome to the Forums
Register the dll with regsvr32
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
Nov 3rd, 2007, 10:47 AM
#3
Thread Starter
New Member
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."
-
Nov 3rd, 2007, 10:51 AM
#4
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?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
Nov 3rd, 2007, 10:56 AM
#5
Thread Starter
New Member
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.
-
Nov 3rd, 2007, 11:01 AM
#6
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|