G
Guest
hi,
i want to import this dll function to c#:
BOOL WINAPI
ReadData(
LPVOID lpBuffer,
DWORD nNumberOfBytesToRead,
LPDWORD lpNumberOfBytesRead
);
I do it so:
[DllImport("MyAPI", SetLastError=true)]
private static extern bool ReadData(
byte[] lpBuffer,
uint nNumberOfBytesToRead,
ref uint lpNumberOfBytesRead,
);
and:
byte[] PacketData=new byte[1514];
uint nBytesRead=0;
bool reValue = ReadData(
PacketData,
(uint)PacketData.Length,
ref nBytesRead);
but its'n work , what have i doing wrong ?
i want to import this dll function to c#:
BOOL WINAPI
ReadData(
LPVOID lpBuffer,
DWORD nNumberOfBytesToRead,
LPDWORD lpNumberOfBytesRead
);
I do it so:
[DllImport("MyAPI", SetLastError=true)]
private static extern bool ReadData(
byte[] lpBuffer,
uint nNumberOfBytesToRead,
ref uint lpNumberOfBytesRead,
);
and:
byte[] PacketData=new byte[1514];
uint nBytesRead=0;
bool reValue = ReadData(
PacketData,
(uint)PacketData.Length,
ref nBytesRead);
but its'n work , what have i doing wrong ?