- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am having a "File Not Found" error when accessing a DLL from VB. The DLL is written using VC++ 6.0 and VB is 6.0. I only have this problem when I am running the program in IDE. When I am running the program using the executable file, I am not having this error. Please help!
Thein
Thein
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a connection to Fortran here? My guess is that there is a dependence on a DLL whose location is not explicitly specified and is not in one of the default places Windows looks for a DLL.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry Steve. Only after posting this message that I realize that I am at the wrong forum. But my problem is kind of strange. I've specified the exact location in the declare statement. When I am running it from IDE, it is giving me an error but when I compiled and run directly from exe, the problem goes away. I've found a work around though. If you open the project directly from the its saved location by double clicking the vbp file, that "File not found" error is avoided. For some reason, when dll files and project files are located in the same directory and if the project is started by selecting one of the entries in the VB's "Recent" tab, it is possible that "File Not Found" error on dll to occur.
Thein
Thein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a second DLL your DLL uses? When Windows activates a DLL, it looks in the following places:
1. The current directory
2. The directory containing the EXE that was run (if you're in the IDE, that's the directory of the IDE's executable)
3. Directories on PATH
4. The Windows folder
5. The Windows System folder
MSVC includes a Dependency Walker tool that can be handy in locating DLL dependencies.
Steve
1. The current directory
2. The directory containing the EXE that was run (if you're in the IDE, that's the directory of the IDE's executable)
3. Directories on PATH
4. The Windows folder
5. The Windows System folder
MSVC includes a Dependency Walker tool that can be handy in locating DLL dependencies.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve, thanks for the suggestion. After I call chdir after the path is set, the problem goes away, even when I am running from IDE. It is still quite strange since I am only having trouble with one particular DLL. Although it calls other DLLs, I am using several others that call the same set, and I do not have any problem with them. Anyway, thanks for your help.
Thein
Thein

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page