- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've built a Fortran COM object using the Fortran COM Server Wizard, and I need to be able to pass an array (from VB) in as one of the parameters to a method. What steps do I need to take to accomplish this? I've looked at the examples, but they don't address the COM code. Keep in mind that I'm fairly new to Fortran, and am primarily a VB programmer.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
If I remember correctly, there is nothing special that you need to do on the VB side. When defining the array argument in the Wizard, select "Array argument" and set the appropriate Fortran data type. If the argument is not a "return value", set the Intent to InOut, even if the array is not modified by the server. If the argument is a "return value", select "Return Value" and set the Intent to Out.
Regards,
Leo
If I remember correctly, there is nothing special that you need to do on the VB side. When defining the array argument in the Wizard, select "Array argument" and set the appropriate Fortran data type. If the argument is not a "return value", set the Intent to InOut, even if the array is not modified by the server. If the argument is a "return value", select "Return Value" and set the Intent to Out.
Regards,
Leo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried doing just that, and get an Invalid Type error. This is really frustrating, as the Wizard appears to be fully array aware. Argh!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, here's wherer I went wrong:
I was testing the DLL from a VBScript file for convenience. When I tested the passing of an array from an actual VB program, it worked fine. I don't know what to do to get it to work from script, but that's not a big deal.
Thanks!!
I was testing the DLL from a VBScript file for convenience. When I tested the passing of an array from an actual VB program, it worked fine. I don't know what to do to get it to work from script, but that's not a big deal.
Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
VB script passes all items as VARIANTs. This definitely complicates programming of the server. I think this was discussed elsewhere in this forum. Try searching for VARIANT.
Leo
VB script passes all items as VARIANTs. This definitely complicates programming of the server. I think this was discussed elsewhere in this forum. Try searching for VARIANT.
Leo

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