- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page