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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Recieving CoreMessage several times

    SDK Help
    0
    4
    307
    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 09/06/2004 at 05:51, xxxxxxxx wrote:

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

      ---------
      i defined some messages using own plug-in IDs and send them with SpecialEventAdd(PLUGINID) to notify another plug-in that some-work is to do.
      now i have the problem, that a message which was send only once (i checked this) will be recieved by the recieving plug-in three times.

        
      Bool Plugin::CoreMessage(LONG id, const BaseContainer& msg)  
      {     switch (id)  
           {       
           case GRADIMSG_RM_TREE_SAVED:  
                {  
                     doanything();  
                } break;  
      

      that makes my recieving plug-in won't work correctly because it starts a function three times instead of one time.

      what does multiply the message and how can i avoid that.

      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 09/06/2004 at 05:53, xxxxxxxx wrote:

        I don't know. One workaround would be to have something you increment in the message container, so that duplicates can be ignored.

        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 09/06/2004 at 06:04, xxxxxxxx wrote:

          how should i increment in the container.
          imagine:
          i send a message once and get it three times. so i will get three times the same container.
          but unfortunately before recieving the message my function will be called the first time. then it starts again.

          i tried to increment a value after recieving a message and want to avoid calling the function if the message arrived second (or more) time. but where should i reset my value to get the function free for the next time i want to call it by myself.

          seems to get tricky...

          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 09/06/2004 at 07:07, xxxxxxxx wrote:

            it's not necessary to do any tricks.
            the undocumented function CheckCoreMessage(msg)
            solved the problem.

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