- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page