- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I am trying to call an in-process server COM dll from intel fortran 12but cannot find example code on how to do so. I currentlyuse C# for calling the com dll after adding a reference but am new to making a call from intel fortran. My C# calling code looks like:
ComSTATE_REF_MIXDLib.ComSTATE_REF_MIXD test = new ComSTATE_REF_MIXDLib.ComSTATE_REF_MIXD();
test.Initialize_Tables(ref_file);
Any help is appreciated! Thanks
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi David,
The process in not very easy. To go simply, you need:
1/ To create a Fortran module containing the interfaces used to call your COM server. Hopefully you can use the "Intel Visual Fortran Module Wizard" to create it. The wizard is available in the Tools menu.
2/ To call COMInitialize at the beginning of the program (and of course COUninitialize() at the end)
3/ use the fortran routines COMCreateObjectByProgID, COMQueryInterface, ... to access the methods available in the COM server.
Here is an example (COM server developped by our company, so you will probably don't have it registered on your computer)
[fortran]use IFCOM .../... call COMInitialize(iStatus) if (iStatus /= 0) pause 'COMInitialize call failed' progID = 'CverStarDustRepository.StarDust_CVER_Repository' call COMCreateObjectBYProdID(progID, iDispRepository, iStatus) if (iStatus /= 0) .... call COMQUeryInterface(iDispRepository, IID_IStarDust_CVER_Repository, iCverRepository, iStatus) if (iStatus /= 0) ... [/fortran]I hope this will help you doing what you are looking for.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi David,
The process in not very easy. To go simply, you need:
1/ To create a Fortran module containing the interfaces used to call your COM server. Hopefully you can use the "Intel Visual Fortran Module Wizard" to create it. The wizard is available in the Tools menu.
2/ To call COMInitialize at the beginning of the program (and of course COUninitialize() at the end)
3/ use the fortran routines COMCreateObjectByProgID, COMQueryInterface, ... to access the methods available in the COM server.
Here is an example (COM server developped by our company, so you will probably don't have it registered on your computer)
[fortran]use IFCOM .../... call COMInitialize(iStatus) if (iStatus /= 0) pause 'COMInitialize call failed' progID = 'CverStarDustRepository.StarDust_CVER_Repository' call COMCreateObjectBYProdID(progID, iDispRepository, iStatus) if (iStatus /= 0) .... call COMQUeryInterface(iDispRepository, IID_IStarDust_CVER_Repository, iCverRepository, iStatus) if (iStatus /= 0) ... [/fortran]I hope this will help you doing what you are looking for.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the last few months, posters have sought and received guidance here as to how to set up a Visual Basic Class Library DLL and make it COM visible so that the IVF Module Wizard can be used on the Type library to generate the code required to create and call the generated COM in-process server from Fortran (the TLB is generated from the VB DLL using the REGASM.EXE tool that is installed with the Microsoft .NET Framework). Doing the same thing with a C# COM server should be very similar (or just use Visual Bsic instead!)
see the following threads:
http://software.intel.com/en-us/forums/showthread.php?t=81356&o=a&s=lr
http://software.intel.com/en-us/forums/showthread.php?t=78835&o=a&s=lr
for code and included links.
If you do a forum search on 'VB DLL' (without the quotes) should supply you with useful threads.
see the following threads:
http://software.intel.com/en-us/forums/showthread.php?t=81356&o=a&s=lr
http://software.intel.com/en-us/forums/showthread.php?t=78835&o=a&s=lr
for code and included links.
If you do a forum search on 'VB DLL' (without the quotes) should supply you with useful threads.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your helpful reply netphilou31. I have it working using your procedure and some additional syntax help from
http://h21007.www2.hp.com/portal/download/files/unprot/fortran/docs/vf-html/pg/pg13suse.htm
Best
http://h21007.www2.hp.com/portal/download/files/unprot/fortran/docs/vf-html/pg/pg13suse.htm
Best
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