- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear All,
I would be really thankful if you could help me with this:
I would like to pass a string parameter to a routine in a library (source code not available) designed for a use in visual basic. The way that it is declared for use in visual basic is as follows:
Declare Function XPRMloadmod Lib "xprm_rt" Alias "_XPRMloadmod@8" (ByVal bname As String, ByVal intname As String) As Long
I am interested in an equivalent fortran interface declaration section as I would like to use the previous function in fortran.
Basically I do not know how to form a visual basic string in fortran.
Many thanks,
Manuel.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Something like this:
fumction XPRMloadmod (bname, intname)
integer XPRMloadmod
!DEC$ ATTRIBUTES STDCALL, REFERENCE, DECORATE, ALIAS:"XPRMloadmod" :: XPRMloadmod
character(1024) bname
!DEC$ ATTRIBUTES REFERENCE :: bname
character(1024) intname
!DEC$ ATTRIBUTES REFERENCE :: intname
You will need somehow to determine the lengths of the strings. I haven't looked, but it might be that VB appends a NUL like C does, so you can do something like:
len_bname = index(bname,char(0)) - 1
len_intname = index(intname,char(0)) - 1
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page