Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

File not found

tmaung
Beginner
876 Views
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
0 Kudos
4 Replies
Steven_L_Intel1
Employee
876 Views
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
0 Kudos
tmaung
Beginner
876 Views
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
0 Kudos
Steven_L_Intel1
Employee
876 Views
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
0 Kudos
tmaung
Beginner
876 Views
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
0 Kudos
Reply