Plugin upgrade to SDK10



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 13/07/2007 at 04:26, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   10 
    Platform:   Windows  ; Mac  ;  Mac OSX  ; 
    Language(s) :     C++  ;

    ---------
    Hi all,

    I have a command plugin written under the SDK9.1. Now, I want to upgrade SDK 10.

    I have the plugin and an other application (APP), which communicates the plugin via a dump file. Always the APP starts the communication, APP calls the maxon and sends the path where the plugin can find the dump file.

    This is the my plugin class:

      
    class Exchange : public CommandData  
    {  
        public:  
            virtual Bool Execute(BaseDocument *doc);  
      
            virtual void Message(const BaseContainer &msg;);  
    };  
    

    and implementation of Message:

      
    void Exchange::Message(const BaseContainer &msg;)  
    {  
        String mess;  
        String cmdline = msg.GetString(0); // <-- here get the path!!  
      
        // DocPath and TmpPath  
        CHAR tmpPathBuffer[1024]   = { 0 };  
      
        // UNITS  
        LONG pos = 0;  
        LONG unit = 0; // default -> no unit  
        // "@" behind the path ?  
        if ( cmdline.FindLast( "@", &pos; ) )  
        {  
            // space behind the "@" ?  
            if ( pos+1 < cmdline.GetLength() )  
            {  
                // get unit from string  
                String strUnit = cmdline.SubStr( pos+1, cmdline.GetLength()-pos-1 );  
                unit = strUnit.StringToLong();  
            }  
      
            // clean path by cutting off the unit  
            cmdline = cmdline.SubStr( 0, pos );  
        }  
      
        // get paths from command string  
        cmdline.GetCString( tmpPathBuffer, 1024 );  
      
        // and so on..  
    }  
    

    And my problem is
    void CommandData::Message(BaseContainer& msg) was changed to LONG CommandData::Message(LONG type, void* data)
    Now, how can I get the message which contains the path?

    Thanx,
    and have a nice day.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 13/07/2007 at 08:25, xxxxxxxx wrote:

    Hi,

    you must type cast the void pointer to the according data (or to CommandInfoData) and check what message has been sent I assume. Maybe you can also directly cast the pointer to a BaseContainer.

    It´s looong time I created a CommandData plugin so this is all just guessed (but you definetly need to type cast the pointer, that´s for sure).

    Maybe the support can help.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 14/07/2007 at 04:51, xxxxxxxx wrote:

    Thanx again, works fine...


Log in to reply