Access violation Problem with BSTRs
Hi gurus,
Code:
if (bstrParam == NULL)
{
CString strOutput("");
return strOutput;
}
else
{
CString strOutput(bstrParam);
return strOutput;
}
Hi gurus I think this is a simple question... but how can I test the value of bstrParam further. I'm getting a problem with the line that says ...CString strOutput(bstrParam) when bstrParam is not properly initialised. How can I test for this? In the debug window bstrParam is 0xcccccccc or something like that.
Thanks.
Re: Access violation Problem with BSTRs
Maybe IsBadReadPtr?
from MSDN:
IsBadReadPtr
The IsBadReadPtr function verifies that the calling process has read access to the specified range of memory.
BOOL IsBadReadPtr(
const VOID* lp,
UINT_PTR ucb
);
Parameters
lp
[in] Pointer to the first byte of the memory block.
ucb
[in] Size of the memory block, in bytes. If this parameter is zero, the return value is zero.