|
-
September 17th, 2004, 07:26 AM
#1
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.
-
September 17th, 2004, 08:49 AM
#2
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|