Hi,
I'm linking against PocoUtil.dll to use the windows registry access methods. When returning from WinRegistryKey::getString I get the _CrtIsValidPointer assertion. I traced the execution in debug mode, everything seems to be fine when executing the last lines of the method :
if (size > 0)
{
char* buffer = new char[size + 1];
RegQueryValueEx(_hKey, name.c_str(), NULL, NULL, (BYTE*) buffer, &size);
buffer[size] = 0;
std::string result(buffer);
delete [] buffer;
return result;
}
"result" contains the expected string but the assertion is detected when its destructor is called after the value is copied to the destination variable.
It seems this is somehow related to a problem to deal with pointers coming from a DLL as explained on this page :
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1691706&SiteID=1
Do you know how to avoid this problem ?
Thanks





