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.

array passing, mixed languages

steve2
Beginner
607 Views
How do you pass arrays between fortran and vb in a dll? Everytime I try to do it, I get an illegal data error in the call statement. I declare an array in my interface section in fortran, and I declare an array in vb, but for some reason it doesn't work. Can anyone give me some help?
0 Kudos
1 Reply
milan2
Beginner
607 Views
FORTRAN CODE:

SUBROUTINE main(MATEFOUT)
!DEC$ ATTRIBUTES DLLEXPORT :: main
!DEC$ ATTRIBUTES ALIAS : 'main' :: main

INTEGER*2 :: MATEFOUT(4000, 2)

BASIC CODE:
Write this in a module:
Public Declare Sub main Lib "myprogram.dll" (MATEF As Integer)
Write this inside your subroutine:
Dim MATEF(1 To 4000, 1 To 2) As Integer
Call main(MATEF(1, 1))

I have experience only with numerical arrays. It works for all numerical variable types.

Hope it helps you,

Milan
0 Kudos
Reply