P
Paul Tomlinson
All, i'm at my wits-end. I have this third party C++ function which I am
trying to call from C#, no matter what I try to do I just can't get it to
work.
This is the function prototype in C++:
long IsValidCompressedFile (
const char *pcszSrcFileName,
BOOL *bValid,
char *origFileName,
long lBufferSize);
This has been (one of) my attempt(s) at accessing it in C#:
[DllImport("external.dll")]
public static extern int IsValidCompressedFile( string srcFileName, ref bool
bValid, ref string origFileName, long lBufferSize );
I've then been using it like so:
....
bool bValid = false;
string strOrigFileName = "";
long validRes = SMSPCIsValidCompressedFile( "c:\new.zip", ref bValid, ref
strOrigFileName, 9999999 );
.....
This particular instance fails with "Object reference not set to an instance
of an object"
Will someone, hell *anyone* please clue me up as to how I can access this
function properly. It's been driving me round the bend.
Thanks in advance.
PT
trying to call from C#, no matter what I try to do I just can't get it to
work.
This is the function prototype in C++:
long IsValidCompressedFile (
const char *pcszSrcFileName,
BOOL *bValid,
char *origFileName,
long lBufferSize);
This has been (one of) my attempt(s) at accessing it in C#:
[DllImport("external.dll")]
public static extern int IsValidCompressedFile( string srcFileName, ref bool
bValid, ref string origFileName, long lBufferSize );
I've then been using it like so:
....
bool bValid = false;
string strOrigFileName = "";
long validRes = SMSPCIsValidCompressedFile( "c:\new.zip", ref bValid, ref
strOrigFileName, 9999999 );
.....
This particular instance fails with "Object reference not set to an instance
of an object"
Will someone, hell *anyone* please clue me up as to how I can access this
function properly. It's been driving me round the bend.
Thanks in advance.
PT