pass VBA string to Fortran DLL

65 views
Skip to first unread message

Ken

unread,
Nov 8, 2006, 1:39:48 AM11/8/06
to gg95
I'm hoping someone has ideas or comments. I've figured out how to pass
a single string using the 'hidden' length:

Fortran
SUBROUTINE fstring ( fstr )
CHARACTER* ( * ) :: fstr

VBA
Declare Sub fstring Lib "FORTEST.dll" (ByVal str As String, ByVal L1 As
Long)
Dim fstr As String * 15
Call fstring(fstr, Len(fstr))

But when I try two strings by adding a 2nd variable to the Fortran
declaration and a 2nd set of String/Long to the VBA declaration) all I
get is a crash.

Any ideas or suggestions? How would I pass an array of strings?

Ken

Reply all
Reply to author
Forward
0 new messages