- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hi all,
I am trying to call functions stored in a VB.net dll from Visual Compaq Fortran. I based my work on the Autodice sample, that is, i created a COM callable wrapper for vb DLL and i then gerenerate the fortran module to use it in my fortran code.
I am getting a "Unhandled exception in Fortran EXE.exe: 0xC0000005: Access violation" when calling the function using this syntax: CALL $ComClsInterface2d_MsgBoxShow(app)
That is now days i am stock on this problem, the COMCREATEOBJECT returns a non 0 value (Which is good?), and when browsing my OLE/COM browser, everything looks fine.
Below is a sample of the VB DLL and Fortran exe program. Do you have any ideas why this is happening? Thanks for answering me.
--------------------------------------------
VB .NET class com
--------------------------------------------
_
Public Class ComClsInterface2d
#Region "COM GUIDs"
Public Sub MsgBoxShow()
MsgBox("Hello world!")
End Sub
Public Sub Calc(ByRef Ivar As Integer)
Ivar = Ivar * 25
End Sub
End Class
--------------------------------------------
Fortran program
--------------------------------------------
program FortranTest
!module to use in this fortran program
USE DFLIB
USE DFWIN
USE DFCOM
USE DFCOMTY
USE DFAUTO
USE Module_VB_Fortran !This is the module generated by the Module Wizard
implicit none
!variable declaration used by the calling module
INTEGER*4 :: hRes, app
!variable declaration use for calculation
integer*4 Ivar
app=0
!START PROGRAM and create object VB DLL
CALL COMINITIALIZE(hRes)
CALL COMCREATEOBJECT ("VB_COM_DLL.ComClsInterface2d", app, hRes)
!check the app nb is not 0
print *, 'app = ',app
!Call the function in VB DLL
!============> IT CRASHES WHEN CALLING THIS SUB:
CALL $ComClsInterface2d_MsgBoxShow(app)
end program FortranTest
I am trying to call functions stored in a VB.net dll from Visual Compaq Fortran. I based my work on the Autodice sample, that is, i created a COM callable wrapper for vb DLL and i then gerenerate the fortran module to use it in my fortran code.
I am getting a "Unhandled exception in Fortran EXE.exe: 0xC0000005: Access violation" when calling the function using this syntax: CALL $ComClsInterface2d_MsgBoxShow(app)
That is now days i am stock on this problem, the COMCREATEOBJECT returns a non 0 value (Which is good?), and when browsing my OLE/COM browser, everything looks fine.
Below is a sample of the VB DLL and Fortran exe program. Do you have any ideas why this is happening? Thanks for answering me.
--------------------------------------------
VB .NET class com
--------------------------------------------
_
Public Class ComClsInterface2d
#Region "COM GUIDs"
Public Sub MsgBoxShow()
MsgBox("Hello world!")
End Sub
Public Sub Calc(ByRef Ivar As Integer)
Ivar = Ivar * 25
End Sub
End Class
--------------------------------------------
Fortran program
--------------------------------------------
program FortranTest
!module to use in this fortran program
USE DFLIB
USE DFWIN
USE DFCOM
USE DFCOMTY
USE DFAUTO
USE Module_VB_Fortran !This is the module generated by the Module Wizard
implicit none
!variable declaration used by the calling module
INTEGER*4 :: hRes, app
!variable declaration use for calculation
integer*4 Ivar
app=0
!START PROGRAM and create object VB DLL
CALL COMINITIALIZE(hRes)
CALL COMCREATEOBJECT ("VB_COM_DLL.ComClsInterface2d", app, hRes)
!check the app nb is not 0
print *, 'app = ',app
!Call the function in VB DLL
!============> IT CRASHES WHEN CALLING THIS SUB:
CALL $ComClsInterface2d_MsgBoxShow(app)
end program FortranTest
Link kopiert
0 Antworten

Antworten
Themen-Optionen
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite