G
Guest
Hi All
I'm trying to import this SDK function in C# but it fails. Here is the code I'm using
...
[DllImport("WinInet.dll", CharSet = CharSet.Auto)
private static extern bool InternetGetLastResponseInfo
[Out] int Error, [MarshalAs(UnmanagedType.LPTStr)] [Out] string sBuffer, [Out] int nBufferLengt
)
...
int nBuffLen = 0
string sBuff = null
InternetGetLastResponseInfo(nError, sBuff, nBuffLen)
sBuff = new string(' ', nBuffLen + 1)
if (InternetGetLastResponseInfo(nError, sBuff, nBuffLen)
sErrMsg += sBuff
That throws an exception (System.NullReferenceException): "Object reference not set to an instance of an object.
I did import almost all other WinInet FTP methods without any glitch
Can someone point me to the right way
Thanks
I'm trying to import this SDK function in C# but it fails. Here is the code I'm using
...
[DllImport("WinInet.dll", CharSet = CharSet.Auto)
private static extern bool InternetGetLastResponseInfo
[Out] int Error, [MarshalAs(UnmanagedType.LPTStr)] [Out] string sBuffer, [Out] int nBufferLengt
)
...
int nBuffLen = 0
string sBuff = null
InternetGetLastResponseInfo(nError, sBuff, nBuffLen)
sBuff = new string(' ', nBuffLen + 1)
if (InternetGetLastResponseInfo(nError, sBuff, nBuffLen)
sErrMsg += sBuff
That throws an exception (System.NullReferenceException): "Object reference not set to an instance of an object.
I did import almost all other WinInet FTP methods without any glitch
Can someone point me to the right way
Thanks