J
JoeB
Hi
Trying to call the following (c++) dll:
void getVersionInfo( long p_lIndex,
char* p_cVersionNumber, int p_iVersBufSize,
char* p_cDescription, int p_iDescBufSize,
BOOL& p_bCompulsory );
So, i do this:
[DllImport("myDll.dll", CharSet=CharSet.Ansi)]
public static extern void
getVersionInfo( long p_lIndex,
ref string p_cVersionNumber, int p_iVersBufSize,
ref string p_cDescription, int p_iDescBufSize,
ref uint p_bCompulsory );
uint iCompulsory = 0;
long index = 0;
getVersionInfo( index,
ref sVersionNumber, sVersionNumber.Length,
ref sDescription, sDescription.Length,
ref iCompulsory );
( The dll will try to write to the strings, and iCompulsory )
But is throws with this error:
An unhandled exception of type 'System.NullReferenceException' occurred in
TestApp32.exe
Additional information: Object reference not set to an instance of an
object.
What am i doing wrong?!
j
Trying to call the following (c++) dll:
void getVersionInfo( long p_lIndex,
char* p_cVersionNumber, int p_iVersBufSize,
char* p_cDescription, int p_iDescBufSize,
BOOL& p_bCompulsory );
So, i do this:
[DllImport("myDll.dll", CharSet=CharSet.Ansi)]
public static extern void
getVersionInfo( long p_lIndex,
ref string p_cVersionNumber, int p_iVersBufSize,
ref string p_cDescription, int p_iDescBufSize,
ref uint p_bCompulsory );
uint iCompulsory = 0;
long index = 0;
getVersionInfo( index,
ref sVersionNumber, sVersionNumber.Length,
ref sDescription, sDescription.Length,
ref iCompulsory );
( The dll will try to write to the strings, and iCompulsory )
But is throws with this error:
An unhandled exception of type 'System.NullReferenceException' occurred in
TestApp32.exe
Additional information: Object reference not set to an instance of an
object.
What am i doing wrong?!
j