On 12/05/2015 at 05:18, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R16
Platform: Mac OSX ;
Language(s) : C++ ;
---------
Hi,
I want to call MCOMMAND_CURRENTSTATETOOBJECT when a button is pressed.
I should do this inside Message()'s MSG_DESCRIPTION_COMMAND, I guess, but if I try it my program crashes.
Is this not possible inside Message?
Here is my code:
if (type == MSG_DESCRIPTION_COMMAND)
{
DescriptionCommand* dc = (DescriptionCommand* )data;
if (dc->id[0].id == MY_BUTTON)
{
BaseDocument* doc = static_cast<BaseDocument*>(data);
if (!doc)
return false;
BaseObject* myObject = doc->GetFirstObject();
if (!myObject)
return false;
ModelingCommandData cd;
cd.doc = doc;
cd.op = myObject;
SendModelingCommand(MCOMMAND_CURRENTSTATETOOBJECT, cd);
}
}
Thanks in advance for your help and time!
Greetings,
Casimir Smets