titanandrews
Programmer
Hi All,
I have a function in a dll which returns a const CString. When called from within the dll, it works fine. But, when I call this function from outside the dll, the function returns garbage. And when the dtor is automatically called (when the CString goes out of scope) I get an assertion failed from MFC. The assert fails on _ASSERTE(_CrtIsValidHeapPointer(pUserData)); The comment for this statement says,
/*
* If this ASSERT fails, a bad pointer has been passed in. It may be
* totally bogus, or it may have been allocated from another heap.
* The pointer MUST come from the 'local' heap.
*/
Has anyone seen this before and knows what I need to do to correct the problem?
many thanks,
Barry
I have a function in a dll which returns a const CString. When called from within the dll, it works fine. But, when I call this function from outside the dll, the function returns garbage. And when the dtor is automatically called (when the CString goes out of scope) I get an assertion failed from MFC. The assert fails on _ASSERTE(_CrtIsValidHeapPointer(pUserData)); The comment for this statement says,
/*
* If this ASSERT fails, a bad pointer has been passed in. It may be
* totally bogus, or it may have been allocated from another heap.
* The pointer MUST come from the 'local' heap.
*/
Has anyone seen this before and knows what I need to do to correct the problem?
many thanks,
Barry