- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
- Balises:
- Intel® Fortran Compiler
Lien copié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Craig, Can you please post the solution that you found for this piece of code? I am having exactly the same problem.
Thanks.
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable