Message 1 of 6
GetUserPropString mangles my MSTR.

Not applicable
12-06-2011
07:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
What is the best way to deal with Object Properties that have a blank data portions.
I am getting bad results if a Key exists and there is no data present. See below.
If a Key exists in the object properties such as below then my_BadString becomes corrupt, and I cannot fill it with data or even test if the my_BadString.data() is NULL or pretty much anything and the my_BadString becomes a bad pointer.
Object Properties =
{
keyWithData = greatThisWorksBecauseThereIsData
keyNoData =
}
I am getting bad results if a Key exists and there is no data present. See below.
void myClass::GetSomeInfo(INode* pointerToNode)
{
MSTR my_BadString;
MSTR my_GoodString;
pointerToNode->GetUserPropString("keyWithData", my_GoodString);
pointerToNode->GetUserPropString("keyNoData", my_BadString);
myClass::FillStringWithData(my_GoodString);
myClass::FillStringWithData(my_BadString);
}
If a Key exists in the object properties such as below then my_BadString becomes corrupt, and I cannot fill it with data or even test if the my_BadString.data() is NULL or pretty much anything and the my_BadString becomes a bad pointer.
Object Properties =
{
keyWithData = greatThisWorksBecauseThereIsData
keyNoData =
}