Intel Visual Fortran Module Wizard

Intel Visual Fortran Module Wizard

Аватар пользователя craig.h

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_Initialize

If anyone has any suggestions or an idea of what the problem may be it would be greatly appreciated.

4 posts / 0 новое
Последнее сообщение
Пожалуйста, обратитесь к странице Уведомление об оптимизации для более подробной информации относительно производительности и оптимизации в программных продуктах компании Intel.
Аватар пользователя anthonyrichards

Have you checked that $OBJECT is a valid pointer toa created object?

Аватар пользователя craig.h

Thanks for the comment. This led me to a solution. One other question:

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

Аватар пользователя Sreenidhi Krishnamoorthy

Craig, Can you please post the solution that you found for this piece of code? I am having exactly the same problem.

Thanks.

Зарегистрируйтесь, чтобы оставить комментарий.