- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
![](/skins/images/06022F5BB6D2F28C8F102671A0F06E85/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page