THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 04/01/2005 at 10:24, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.100
Platform: Windows ;
Language(s) : C++ ;
---------
Hello,
i have problems storing persistent data (like member variables) in my from ObjectData derived class:
class C4DNode_NodeData: public ObjectData
{
INSTANCEOF(C4DNode_NodeData,ObjectData)
private:
String teststring;
public:
virtual Bool Init(GeListNode *node);
virtual Bool GetDDescription(GeListNode *node, Description *description,LONG &flags;);
void SetString(String _g);
};
...
//the following functions are in the same order in that they are called
Bool C4DNode_NodeData::Init(GeListNode *node)
{ teststring = "initvalue";
return TRUE;
}
void C4DNode_NodeData::SetString(String _g)
{ teststring = "newvalue";
}
Bool C4DNode_NodeData::GetDDescription(GeListNode *node, Description *description,LONG &flags;)
{ ...
GePrint(teststring); //here is teststring "initvalue", not "newvalue"
...
}
I tried the same with a BaseContainer, but the function SetString() doesn't change the value. But if i change an existing container of my description in SetString() with ...->SetLong(TESTID, 1) the value is changed in my object. What's wrong? Is there a better way to store member variables?
Thanks for any help,
Torsten