- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve (or others):
I'm trying to provide a few subroutines in a dll that can be called from Visual Basic. There have been several posts on this forum on this topic in the past couple of years and I've consulted those to make sure I've put things together correctly. However . . . the VB program keeps giving a "dll not found" error. Careful rechecking shows that the path to the dll in the VB delcare statement is correct, and the dll is in designated folder. The VB program/system is on adifferent machine.
I know the dll is correct since I can call the routines from within this same dll from a Fortran console application I built. The dll doesn't need to be registered, does it?
David DiLaura
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No registration needed. Have you looked at the MixedLanguageVB-Calls-Fortran sample provided (10.0 and later) to see a worked example?
Most of the time, this error is caused by a dependent DLL not being in PATH. Download Dependency Walker and have it analyze your DLL to see what it finds. Note that VB will report "DLL not found" for any of a number of errors which may have nothing to do with "finding" the DLL.
My guess is that you do not have the dependent Fortran run-time DLLs on the other machine in a place found on PATH. MSVC DLLs may also be required to be installed. For your purpose, it may make sense to change the Fortran DLL project property Libraries > Use run-time libraries to specify "Multi-Threaded" instead of "Multi-Threaded DLL" so that you are not dependent on run-time DLLs. Thsi is fine as long as there is no Fortran code calling your DLL.
Most of the time, this error is caused by a dependent DLL not being in PATH. Download Dependency Walker and have it analyze your DLL to see what it finds. Note that VB will report "DLL not found" for any of a number of errors which may have nothing to do with "finding" the DLL.
My guess is that you do not have the dependent Fortran run-time DLLs on the other machine in a place found on PATH. MSVC DLLs may also be required to be installed. For your purpose, it may make sense to change the Fortran DLL project property Libraries > Use run-time libraries to specify "Multi-Threaded" instead of "Multi-Threaded DLL" so that you are not dependent on run-time DLLs. Thsi is fine as long as there is no Fortran code calling your DLL.

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