Storage of data
-
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 -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 07/01/2005 at 02:56, xxxxxxxx wrote:
Problem solved (in an unusual way).
I change my member variables by sending a message.... void C4DNode_NodeData::SetString(String _g) { String gtemp = "newvalue"; ((PluginObject* )this)->Message(UWM_MYOWNMESSAGE, >emp;); } Bool C4DNode_NodeData::Message(GeListNode *node, LONG type, void *t_data) { if(type == UWM_MYOWNMESSAGE) { String* gtemp = (String* )t_data; g = gtemp->SubStr(0,gtemp->GetLength()); //found no better way to get String from String* } return TRUE; } ...
Torsten