We have a Fortran DLL that currently is being used by a VB DotNet project.
The VB side has user defined structures that correspond to User Defined Kinds in fortran.
Currently, we are passing in arrays of user defined structures to the Fortran DLL using un-managed code.
The Fortran Dll writes out its results to text files and is working fine in that regard.
The Fortran function being called is a long-running procedure generating results for a simulation. It may take many minutes to complete.
We need to change the DLL to a COM Compliant dll so that we may interact with a COM object from the VB dotNet code in a
more sophisticated manor. We need to be able to monitor the status of the simulation and get the results as arrays of structures that we pass in ByRef when we make the call to the DLL.
We have created a test project using the Intel Compiler version 10.1.011
In that project we have defined the following structure
Public Structure ProbParamKind
Dim Na As Int32
Dim Nc As Int32
Dim Nstep As Int32
Dim MaxCycles As Int32
Dim AxialPts As Int32
We have not been able to pass in this structure as an argument to a call named UseCustomType
Using the hie file we defined a method called UseCustomType. We added an argument named SingleProbParam
we have tried all c
ombinations we can think of in the argument's properties
Currently we have
Assumed-Shape = false
By Reference = true
Dimensions = 0
Fortran Type = TYPE(VARIANT)
IDL Type = VARIANT
Intent = [in/out]
Is Optional = false
When we call the function, we get the following exception:
System.ArgumentException was unhandled
Message="Value does not fall within the expected range."
We have tried every data type as the Fortran Type and IDL Type
and get different errors depending upon which type is selected.
Also, each time we change the hie file, we have to go into the system generated helper files and add use ifcore to the function in order to get the project to compile
function IDelsComServer_UseCustomType( ObjectData ,&
SingleProbParam) result (hresult)
use ifcore 'added by hand
!dec$ attributes reference :: ObjectData
TYPE(VARIANT), intent(in) :: SingleProbParam
; integer(long) hresult
Since we cannot pass in even a single instance of this sturcture, we cannot pass in an array of these structures.
We have contacted Premire support and they sent us to this forum since they had no answer for us.
Our question then is this:
How do we configure the hie file to accept a user defined structure as an argument?
My guess is that the Fortran Type and IDL types need to be something different.
Do we need to be defining the structure as a pointer to a memory address?
Would this be INT_PTR_KIND?
Can we enter an option in the argument property's that are not in the pick list such as INT_PTR_KIND?
Any suggestions are welcomed.