- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have an automation server (64 bit dll with callable method) with a client in IVF. The client's interface was created using the Intel Visual Fortran Module Wizard and runs in 32 bit mode. Using the information from the Compaq Visual Fortran Programmers Guide on Automation/COM I managed to get things working in so far that my client calls the server, returning success.
The server now simply returns two integer values and I have to find out how to retrieve these values in my client. Though there is some information on the internet, largely for the C languages, I cannot find how to do this in Fortran.
My automation interface is like this (output arguments fa1, fa2)
SUBROUTINE IClassCOMsrv_COMsrv($OBJECT, nargout, fa1, fa2, a1, a2, a3, $STATUS)
!DEC$ ATTRIBUTES DLLEXPORT :: IClassCOMsrv_COMsrv
IMPLICIT NONE
INTEGER(INT_PTR_KIND()), INTENT(IN) :: $OBJECT ! Object Pointer
!DEC$ ATTRIBUTES VALUE :: $OBJECT
INTEGER(4), INTENT(IN) :: nargout
!DEC$ ATTRIBUTES REFERENCE :: nargout
TYPE (VARIANT), INTENT(INOUT), VOLATILE :: fa1
!DEC$ ATTRIBUTES REFERENCE :: fa1
TYPE (VARIANT), INTENT(INOUT), VOLATILE :: fa2
!DEC$ ATTRIBUTES REFERENCE :: fa2
TYPE (VARIANT), INTENT(IN) :: a1
!DEC$ ATTRIBUTES REFERENCE :: a1
TYPE (VARIANT), INTENT(IN) :: a2
!DEC$ ATTRIBUTES REFERENCE :: a2
TYPE (VARIANT), INTENT(IN) :: a3
!DEC$ ATTRIBUTES REFERENCE :: a3
INTEGER(4), INTENT(OUT), OPTIONAL :: $STATUS ! Method status
!DEC$ ATTRIBUTES REFERENCE :: $STATUS
Call IClassCOMsrv_COMsrv(matlab_app, nargout, vfa1, vfa2, va1, va2, va3, status)
where input arguments va1, va2, va3 are properly initialized as variants of type VT_I4 and value VU%LONG_VAL and vfa1 and vfa2 are declared as variants.
result = VariantCopyInd( pv, v )
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is very little expertise available on using COM from Fortran. There's one sample provided, but it likely doesn't help you.
Do you know what the value should be? Might it be as simple as referencing VFA1%VU%LONG_VAL?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page