Hello fellows,
I recently wanted to get onto the C++ side again making a little plugin working my way up.
So far it is rather blank and just prints out a message. Next step was trying to get a value via executeCommand from a global variable called $Source created by my mel-script.
MStatus MyCommand::doIt(const MArgList &argList)
{
MStatus status;
MGlobal::displayInfo("MyCommand did it");
MString result;
MString cmdStr = "proc string getSource() { global string $Source; return $Source;};";
MGlobal::executeCommand(cmdStr, result);
if (status != MS::kSuccess)
{
return status;
}
}
As far as I have read, this error comes up if a variable is not initialized. But if I understood it correctly, MString should be initialized on creation…
Looking into other examples there is no difference in the declaration.
So, where did I go wrong?
