Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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
    • Recent
    • Tags
    • Users
    • Login

    CallCommand from different thread?

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 358 Views
    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 Offline
      Helper
      last edited by

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

      On 27/08/2008 at 16:29, xxxxxxxx wrote:

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

      ---------
      Hi!

      Does anyone know, how to call CallCommand from a different thread?
      I can't find a principe to do it, because CallCommand requires the MainThread.. what would you suggest?

      Thank you...

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

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

        On 28/08/2008 at 03:24, xxxxxxxx wrote:

        It seems to work for me, see code:

        > \> class MyThread : public Thread \> { \>      private: \> \>      public: \>           MyThread() { } \>           virtual ~MyThread() { End(); Wait(FALSE); } \> \>           virtual void Main(void); \>           virtual const CHAR \*GetThreadName(void) { return "Test Thread"; } \> }; \> \> void MyThread::Main(void) \> { \>      GePrint("render thread"); \>      CallCommand(5159); \> } \> \> class MenuTest : public CommandData \> { \>      public: \>           virtual Bool Execute(BaseDocument \*doc); \> }; \> \> Bool MenuTest::Execute(BaseDocument \*doc) \> { \>      MyThread mt; \>      mt.Start(FALSE); \> \>      return TRUE; \> } \>

        cheers,
        Matthias

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

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

          On 28/08/2008 at 14:55, xxxxxxxx wrote:

          Hi!

          Perhaps I am wrong, but I checked out CallCommand

          void CallCommand(LONG id, LONG subid)
          {
                if (!GeIsMainThread()) return;
               BaseContainer msg(COREMSG_CINEMA_EXECUTEEDITORCOMMAND);
               msg.SetLong(COREMSG_CINEMA_EXECUTEEDITORCOMMAND, id);
               msg.SetLong(COREMSG_CINEMA_EXECUTESUBID,subid);
               SendCoreMessage(COREMSG_CINEMA, msg, 0);
          }

          and if CallCommand is not called from the main thread, it aborts, so it shouldn't be executed, should it?

          Thanks a lot.

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

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

            On 03/09/2008 at 15:43, xxxxxxxx wrote:

            Hi Matthias,

            you wrote that CallCommand works in a different thread. Do you know why this works, altough !GeIsMainThread() should prevent that?

            Bye.. 🙂

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