Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29280 Discussions

Docs for Calling Fortran DLL from Visual Basic?

Kipling__Michael
Beginner
462 Views

Steve,

Is there documentation available that discusses calling routines in Fortran DLL's using Visual Basic? I have seen several topics in the forums which discuss specific problems, but nothing structured.

I am passing individual values as well as multiply dimensioned arrays of numbersand character strings.

I have been doing this for years using Delphi (Pascal) to call the Fortran DLL's.

Thanks,

Mike Kipling

0 Kudos
3 Replies
Kevin_D_Intel
Employee
462 Views

IVF 10.1 includes a specific sample named VB-Calls-Fortran that might help.

C:Program FilesIntelCompilerFortran10.1.xxxsamplesMixedLanguageVB-Calls-Fortran

The IVF documentation contains an extensive discussion about mixed-language programming. This is accessible via the index: Intel Visual Fortran Compiler Documentation > Building Applications > Programming with Mixed Languages

There are specific sections devoted exchanging and accessing data and handling data types.

Perhaps these will help.

0 Kudos
Kipling__Michael
Beginner
462 Views

IVF 10.1 includes a specific sample named VB-Calls-Fortran that might help.

C:Program FilesIntelCompilerFortran10.1.xxxsamplesMixedLanguageVB-Calls-Fortran

The IVF documentation contains an extensive discussion about mixed-language programming. This is accessible via the index: Intel Visual Fortran Compiler Documentation > Building Applications > Programming with Mixed Languages

There are specific sections devoted exchanging and accessing data and handling data types.

Perhaps these will help.

Kevin,

I was aware of the documentation you referenced as well as the sample program vb-calls-fortran. The problem that I am having is in trying topass arrays with more than one dimension. I do not understand why the sample program works, since the single dimensioned arrays are dimensioned in VB as DBL_IN(4) and DBL_OUT(4). This means there are 5 elements in each since the lower bound is 0. In the Fortranroutine they are dimensioned asDBL_IN(4) and DBL_OUT(4) also, which results in only 4 elements ineach array.

This coding works, I just do not understand why. The bigger problem for me is trying to extend this methodto passing a doubly dimensioned array. I have tried to modify the code to use only one variable DBL_INOUT to handle both the input and output values. I've tried dimensioning the VB variable as DIM DBL_INOUT(4,2) and DIM DBL_INOUT(4,1), and I also triedvarious dimensions in the FORTRAN routine with no success.

Mike

0 Kudos
Kevin_D_Intel
Employee
462 Views
Hi Mike,

I do not have an specific example on hand that would help here. If you have not already checked it out, the VB.NET-SafeArrays sample may help too. This sample declares a double dimension array on the VB-side and determines the array dimensions dynamically on the Fortran side. It is not an exact match to your interests, but it may offer some other ideas.

Kevin

0 Kudos
Reply