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

Calling dll from VB

grt
Beginner
657 Views
I have a dll that was created under DVF 5.0 and when called from VB runs ok. However, the same dll does not work on a PC running CVF 6.1, either when compiled under CVF 6.1 or when the DVF 5.0 complied dll is copied over.

The following error message is returned at the point where the dll is called from VB:

File not found: C:\WINDOWSSYSTEMNAMEDLL.DLL

Has anyone come across this problem or a similar problem and is there a solution?

Graham Tattersall
0 Kudos
3 Replies
matthewkmk
Beginner
657 Views
I think you need to mention the path you have put the dll file in the declaration part.
0 Kudos
alxx
Beginner
657 Views
The way to call the dll changed between dvf5 and cvf6.

Suggest you look at examples
http://h18009.www1.hp.com/fortran/downloads.html
http://h18009.www1.hp.com/fortran/examples/
and
http://h18009.www1.hp.com/fortran/visual/overview.html

specifically
http://h18009.www1.hp.com/fortran/examples/vb-example1.html

I've found it to be easier to
use a relative path rather than a fixed path
to tell the exe where to find the dll.
IE have the dll in the current directy or a subdirectory
of the executable file
especially if having to deal with multiple versions of windows -> win98 , win me, win2000 and xp
rather than having a fixed path in the executable.

Alex
0 Kudos
Steven_L_Intel1
Employee
657 Views
Alex,

As far as I know, nothing changed between the two versions of Visual Fortran as far as calling DLLs is concerned.

You can get this sort of error if one of the dependent DLLs is not found - especially if running the DLL on a PC that doesn't have CVF installed.

Steve
0 Kudos
Reply