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

    2 Timers... Safe?

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 284 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 22/02/2011 at 08:24, xxxxxxxx wrote:

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

      ---------
      Hey all,

      Just curious if running 2 identical timers simultaneously is safe to do.  I have a timer in a MessageData class and have been forced to use another in a GeDialog.  Both timers tick by at exactly the same interval.  I tried to get around this by trying to get the message from my MessageData to the dialog, but I haven't had any luck doing that.

      If this isn't a safe thing to do, does anyone know a way to get a message from a MessageData class to a dialog?  Even if having this second timer running is relatively safe, I'd still like to know if this is possible... I've already had some issues with timers in the past, so I'd feel better not having to use the Timer function of the GeDialog class if I can avoid it.

      thanks!
      -kvb

      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 23/02/2011 at 03:27, xxxxxxxx wrote:

        I'm not sure about two timers but I suppose you could send a SpecialEventAdd() from the MessageData. This will result in a CoreMessage which you can catch in every dialog.

        Something like this:

          
        class MyMessage : public MessageData  
        {  
          public:  
              virtual LONG GetTimer(void);  
              virtual Bool CoreMessage(LONG id, const BaseContainer& bc);  
        };  
          
        LONG MyMessage::GetTimer()  
        {  
          return 1000;  
        }  
          
        Bool MyMessage::CoreMessage(LONG id, const BaseContainer &bc)  
        {  
          if (id == MSG_TIMER)  
          {  
              SpecialEventAdd(1024558, 0, 0); //send your own unique ID  
          }  
          
          return TRUE;  
        }  
        

        in the dialog:

          
        Bool MyDialog::CoreMessage(LONG id, const BaseContainer& msg)  
        {  
          if (id == 1024558)  
          {  
              //do something  
          }  
            
          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 23/02/2011 at 13:58, xxxxxxxx wrote:

          Matthias... you are my hero!  How could I forget about SpecialEventAdd!  Working perfectly:)

          thanks again!
          -kvb

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