The functions GetErrorStr1 and GetErrorStr2 call GetStr() on a member variable that is a StrPair. If this member variable last operation had been a reset (which is the case most of the time) then call GetStr() will cause the code to throw an assertion. This throw will cause most applications to crash since there is no code to catch that exception. I would suggest the follow changes to those two routines:
const char* XMLDocument::GetErrorStr1() const
{
if (_errorStr1.Empty())
{
return NULL;
}
return _errorStr1.GetStr();
}
const char* XMLDocument::GetErrorStr2() const
{
if (_errorStr2.Empty())
{
return NULL;
}
return _errorStr2.GetStr();
}
This is a simple addition of an "if statement" to check to see if the StrPair is empty and if so return a NULL;
Thanks
Larry