- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve:
In one of the old posting you have mentioned a code for VB.net calling CVF. (
This link seems to no longer exist. It would be of great help if you could provide that example again or point me in the right direction. Actuallyweare trying to pass strings to and from a fortran.dll from/to VB.net and running into problems. I dont have much background in VB.net
Thanks for the help
GK
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yeah, HP has really messed up their Fortran web site...
I have attached an example of VB calling Fortran that uses Intel Fortran. The concepts are the same for CVF. This sample passes an array of reals. If you want to pass a string, you pass it "by value" in VB and accept in Fortran with the REFERENCE attribute on the routine and argument to prevent it from looking for a length (or pass the length as a long by value in the appropriate position.)
Note that you need to make sure the Fortran DLL is where VB wants to see it. In this sample, I had it put in the VB project's Debugin subfolder.
I have attached an example of VB calling Fortran that uses Intel Fortran. The concepts are the same for CVF. This sample passes an array of reals. If you want to pass a string, you pass it "by value" in VB and accept in Fortran with the REFERENCE attribute on the routine and argument to prevent it from looking for a length (or pass the length as a long by value in the appropriate position.)
Note that you need to make sure the Fortran DLL is where VB wants to see it. In this sample, I had it put in the VB project's Debugin subfolder.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much. I will give it a shot
Regards
GK
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