Mixed Language Programming: VB/Fortran

Mixed Language Programming: VB/Fortran

I am working on a project with mixed language programming Visual Basic~Fortran. A .dll file (ZFact.DLL) is created from a Fortran source code with several Subroutines, Functions, and a Block Data group. Each of the Subroutines and Functions (but not the Block Data group) has the ATTRIBUTES Directive with the DLLEXPORT property declared as shown below:

? etc.

The VB program declares the Fortran subroutines (in the .dll file) in the `declarations? section of its module as follows:

Declare Sub PARAMDL Lib "C:Program FilesMicrosoft Visual StudioVB98MyProjectsFacorFact.dll" (NCC As Integer, CID() As Integer)

Declare Sub CHARDL Lib "C:Program FilesMicrosoft Visual StudioVB98MyProjectsFacorFact.dll" (NCC As Integer, XI() As Double,ZB As Double, DB As Double)

? etc.

Yet, the VB program executes up to the point it makes the first call to a subroutine in the .dll file and then crashes with the following error message:

Run-time error ?53?:
File not found: C:Program FilesMicrosoft Visual

The .dll file (ZFact.dll) and the corresponding library file (ZFact.lib) are there in the same directory as specified above ? I have checked.

Any ideas or help from any one?

Just in case this has any relationship to the problem ? the call to subroutine in VB and the Subroutine declaration in Fortran along with data type declaration statements are given below:

VB Program:
Public CID(1 To 21) As Integer, NCC As Integer

Fortran .dll File:

Is the entire array CID being passed on correctly from VB to Fortran?


Krishna Sinha

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The "error 53" has nothing to do with the way you're calling the routine - it isn't getting that far. The error message is misleading - it can come up if your DLL depends on other DLLs that are not found. See http://www.compaq.com/fortran/kb/q1023.html for part of the solution, though another thing can be if you build a Debug configuration DLL and take it to a system where CVF isn't installed. The solution there is to build a Release configuration (and install the run-time DLLs as in the article.)


Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today