- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would like to pass strings between VB applications and Fortran DLLs.
Any help would be greatly appreciated. I'm wondering what the !DEC ATTRIBUTE statements look like and what the VB Declare statements are for these two cases. Are the conventions the same in VS2005 ?
1.
I would like to pass to a Fortran DLL:
CHARACTER(*),INTENT(IN)::strIN
2.
I would like VB app to receive a stringfrom a Fortran DLL:
CHARACTER(*),INTENT(OUT)::strOUT
INTEGER(4), INTENT(OUT):: LEN_strOUT
Again, any help is greatly appreciated,
Cliff Phares
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
See the MixedLanguageVB-Calls-Fortran sample provided with 10.0. If you use CHARACTER(*), the VB code has to pass the length by value at the end of the argument list. On the VB side, you have to pass the string ByVal.
As long as you're not trying to change the length of the string, you can return a string from Fortran. If you want more, then you have to get into "BSTRINGs", as illustrated in the VB.NET-Saferarrays sample.
As long as you're not trying to change the length of the string, you can return a string from Fortran. If you want more, then you have to get into "BSTRINGs", as illustrated in the VB.NET-Saferarrays sample.

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