Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Help needed with Fortran and COM

Intel_C_Intel
Employee
238 Views
I have the following problem.
I am using a commercial program for static calculations called RSTAB.
Now this program has the possibility to exchange data by a COM interface.
I have a example programme written in Excel VB.
Now since I am a 'old' fortraneer and not a VB programmer, I want to do the same thing using CVF6.6.
That is exchange data between RSTAB an my own Program.

I have a type library called RSTAB.ltb. I converted this library using the Module Wizard to a .f90 file.
This file is rather long (more than 9000 lines). It contains mostly type declarations and functions.
When compiling this file is turned into a .lib file.
My basic problem is : How to connect my program to the COM Interface.

I studied the CVF Examples ( e.g. Autodice etc.) and the CFV Manual, but I still don't get the trick.
I guess I have to use COMCREATEOBJECT somehow to do the connection.
My program has the following lines:

use RSTABCOM ! <== this is the converted .tlb file
integer*4 :: status,app

CALL COMINITIALIZE(status)
CALL COMCREATEOBJECT ("RSTAB", app, status)


But this does not work. I guess the name "RSTAB" is wrong.
What name do I have to use in the COMCREATEOBJECT call ????
I think this is my basic problem.

The VB Code starts with the following lines
------------------------------------------------
Dim RSApp As RSTAB.IrsApplication
Dim RSPos As RSTAB.Position
Dim RSTop As RSTAB.IrsTopology

Private Sub CommandButton1_Click()
Set RSPos = GetObject(, "RSTAB.Position")
Set RSApp = RSPos.rsGetApplication
RSApp.rsLockLicence
Set RSTop = RSPos.rsGetTopology
.
.
---------------------------------------------------
RSTAB is the name of the commercial program.

Can somebody help me since I am really stuck.
Thanks
Klaus
0 Kudos
0 Replies
Reply