I think you can pass it ByRef as an argument.
Printable View
I think you can pass it ByRef as an argument.
I'm not trying to pass the structure to the dll. I'm try to return the structure from the DLL to VB. I declare the c++ function in the DLL to have a return value of CODES * (which is a pointer to my c++ structure). In VB I declare the return value as CODES (which is a UDT with the same varibles defined as the c++ structure). However, when I use the variables they have bogus information. Code is as follows:
C++
typedef struct CODES
{
int sH;
int rC;
} CODES;
CODES * _stdcall fnCpp(char * dbF, int aM, char * sN, int cT, char * aN)
VB declaration
Public Type CODES
intSH As Integer
intRC As Integer
End Type
Public Declare Function fnCpp Lib "C:\cpp\cppfile.dll" _
(ByRef strDb As String, ByVal intAM As Integer, _
ByRef strSN As String, ByVal intCT As Integer, _
ByRef strAN As String) As CODES