Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Using pluginmessage to call a function?

    SDK Help
    0
    3
    327
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

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

      On 16/01/2007 at 13:03, xxxxxxxx wrote:

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

      ---------
      Hello.
      I have made a commandplugin, and I would like to call a function (not neccesarily execute()) in my plugin from another plugin. I read in a thread in this forum that I could do this using pluginmessages, but I don't really understand how.
      I have made my other plugin send a GePluginMessage that is recieved by the first plugin, but I don't understand where to go from there since I don't have access to an instance of my commandplugin from pluginmessage().
      Any suggestions?
      regards
      /Filip

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

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

        On 20/01/2007 at 01:42, xxxxxxxx wrote:

        I have solved this using

            
            
            
            
            BasePlugin* pl = FindPlugin(ID_OF_MYCOMMANDPLUGIN);  
             MyCommandPlugin* m=static_cast<MyCommandPlugin*>(pl->GetPluginStructure());  
               m->MyFunction();
            
            
            
        

        Does anybody know a more elegant way?
        regards
        Filip

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

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

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

          You could pass the this pointer of the plugin and cast it within the PluginMessage function.

          from somewhere in your plugin

          GePluginMessage(MY_MESSAGE, this);

          and within PluginMessage of your other plugin

          case MY_MESSAGE:
          ((MyPlugin* )data)->DoSomething();

          cheers,
          Matthias

          1 Reply Last reply Reply Quote 0
          • First post
            Last post