thks for reply,
here the declaration in c
struct tEZL_GETLASTTRAN {
long device_id;
long result;
char tranDate[10];
char tranTime[8];
long tranValue;
int svcProviderId;
int tranType;
};
extern "C" __declspec(dllexport) int ezif_getlasttran(struct
tEZL_GETLASTTRAN *pkt);
and on vb.net
Public Structure tEZL_getLastTran
Public device_id As Integer
Public result As Integer
<VBFixedString(10)> Public tranDate As String
<VBFixedString(8)> Public tranTime As String
Public tranValue As Integer
Public svcProviderId As Short
Public tranType As Short
End Structure
<DllImport("EZLINTFC.DLL", EntryPoint:="ezif_getlasttran", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True, _
CallingConvention:=CallingConvention.Cdecl)> _
Private Shared Function ezif_getlasttran(ByRef arg_tEZL_getLastTran As
tEZL_getLastTran) As Short
' ' Leave function empty - DLLImport attribute
End Function
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ut****************@TK2MSFTNGP15.phx.gbl...
"Cc" <ko*****@singnet.com.sg> schrieb: how do I pass fixed string byref to a dll . I had try
<VBFixedString(10)>
but when I run I keep getting system.accessviolation
Can you post the C/C++ function prototype and your 'Declare' statement?
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>