- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
Hello everyone,
I have a function that loads a file into memory and returns a reference to that object. The function header looks like this:
logical(2) function CMaToV3Mat( cFile, pMat )
!DEC$ ATTRIBUTES DLLEXPORT, ALIAS:'CMaToV3Mat' :: CMaToV3Mat
use V3MatRow
implicit none
type (T_MATRIX), pointer :: pMat
character(len = *) :: cFile
!DEC$ ATTRIBUTES DLLEXPORT, ALIAS:'CMaToV3Mat' :: CMaToV3Mat
use V3MatRow
implicit none
type (T_MATRIX), pointer :: pMat
character(len = *) :: cFile
...
end function
end function
The vb.net declare looks like this:
Private Declare Function CMaToV3Mat Lib "V3MatD.DLL" ( _
ByVal cFile As String, _
ByVal iLenFilename As Integer, _
ByRef hMatrix As Integer _
) As Boolean
During execution I get for both cFile and pMat 'undefined address'. When I use pMat as first argument everything works fine. VB6/CVF6.6C used to accept the original argument order, why does VB.Net/IVF8.1 not or did I miss anything?
Thanks in advance.
Felix Obermaier
Link copiato
1 Rispondere
- Contrassegnare come Nuovo
- Preferito
- Iscriversi
- Disattiva notifiche
- Iscriversi a feed RSS
- Evidenziare
- Stampare
- Segnalare contenuto inappropriato
I encourage you to read my "white paper" on migrating from CVF to Intel Visual Fortran. It addresses the issues you encountered. Pay close attention to the section on default calling convention changes, in particular the change from STDCALL to C and the change of where string lengths are passed.
Rispondere
Opzioni discussione
- Iscriversi a feed RSS
- Contrassegnare la discussione come nuova
- Contrassegnare la discussione come letta
- Sposta questo Discussione per l'utente corrente
- Preferito
- Iscriversi
- Pagina in versione di stampa