- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to use the Intel Visual Fortran Module Wizard to generate code to interact with a VB.net assembly which implements a COM interface. The assembly is registered on the computer but not in the GAC. The COM interface was created by the compiler and not explicitly. COM works fine with MS Excel and other applications. Im having trouble getting it to work in my Fortran project.
It seems like the module wizard generated the interfaces fine but when I try to call one of the functions I get the following error message:
Unhandled exception at 0x0040a8cd in spxctselect.exe: 0xC0000005:
Access violation reading location 0x00000001.
This happens when the following statement is executed:
$$STATUS = AUTOINVOKE($OBJECT, 1610743814, invokeargs)
The statement is executed in the following code which was generated by the wizard:
LOGICAL(2) FUNCTION $Application_Initialize($OBJECT, UserName, PassCode, DataFile, $STATUS)
IMPLICIT NONE
INTEGER(INT_PTR_KIND()), INTENT(IN) :: $OBJECT ! Object Pointer
!DEC$ ATTRIBUTES VALUE :: $OBJECT
CHARACTER(LEN=*), INTENT(IN) :: UserName ! BSTR
CHARACTER(LEN=*), INTENT(IN) :: PassCode ! BSTR
CHARACTER(LEN=*), INTENT(IN) :: DataFile ! BSTR
INTEGER(4), INTENT(OUT), OPTIONAL :: $STATUS ! Method status
!DEC$ ATTRIBUTES REFERENCE :: $STATUS
LOGICAL(2), VOLATILE :: $RETURN
INTEGER(4) $$STATUS
INTEGER(INT_PTR_KIND()) invokeargs
invokeargs = AUTOALLOCATEINVOKEARGS()
CALL AUTOADDARG(invokeargs, '$RETURN', $RETURN)
CALL AUTOADDARG(invokeargs, '$ARG1', UserName, AUTO_ARG_IN, VT_BSTR)
CALL AUTOADDARG(invokeargs, '$ARG2', PassCode, AUTO_ARG_IN, VT_BSTR)
CALL AUTOADDARG(invokeargs, '$ARG3', DataFile, AUTO_ARG_IN, VT_BSTR)
$$STATUS = AUTOINVOKE($OBJECT, 1610743814, invokeargs)
IF ($$STATUS == DISP_E_EXCEPTION) CALL $$DisplayError(invokeargs)
IF (PRESENT($STATUS)) $STATUS = $$STATUS
$Application_Initialize = $RETURN
CALL AUTODEALLOCATEINVOKEARGS (invokeargs)
END FUNCTION $Application_InitializeIf anyone has any suggestions or an idea of what the problem may be it would be greatly appreciated.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was using this COM which was alreadycreatedas a test for future plans. The new COM would need to pass arrays and user defined types. Will there be a problem passing these between Fortran and the COM?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Craig, Can you please post the solution that you found for this piece of code? I am having exactly the same problem.
Thanks.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page