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:
!DEC$ ATTRIBUTES DLLEXPORT :: PARAMDL
!DEC$ ATTRIBUTES DLLEXPORT :: ZDETAIL
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)
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:
Call PARAMDL(NCC, CID())
Public CID(1 To 21) As Integer, NCC As Integer
Fortran .dll File:
SUBROUTINE PARAMDL (NCC, CID)
INTEGER NCC, CID(21)
Is the entire array CID being passed on correctly from VB to Fortran?