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

    Is dialog alive?

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 353 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 16/11/2008 at 08:13, xxxxxxxx wrote:

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

      ---------
      Hi!

      The class BaseBitmapLink and BaseLink returns NULL if the object is not alive when deleted. I have a hook in ToolData which returns a SubDialog in 'AllocSubDialog' where Cinema 4D takes the ownership.

      Is a class avaible which returns NULL if the Dialog was deleted?

      Cheers,

      Shawni

      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 17/11/2008 at 14:12, xxxxxxxx wrote:

        Hi! problemo solved 🙂

        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 18/11/2008 at 02:09, xxxxxxxx wrote:

          Do you mind to share how you solved the problem?

          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 18/11/2008 at 03:25, xxxxxxxx wrote:

            Hi! 🙂

            Sure, I wanted to write, but I forgot in hectic. I wrote my own class like BaseLink, BaseBitmapLink.

            > \>      class DialogClassLink \>      { \>           private: \>                void \*obj; \>           public: \>                DialogClassLink(); \>                void \*Get(); \>                void Set(void \*bmp); \>      }; \> \>           DialogClassLink::DialogClassLink() \>           { \>                obj = NULL; \>           } \> \>           void\* DialogClassLink::Get() \>           { \>              return obj; \>           } \> \>           void DialogClassLink::Set(void \*bmp) \>           { \>              obj = bmp; \>           } \> \>

            So this is my class which should return NULL if the dialog is not alive.

            > \> \> class csDialogClass : public SubDialog \> { \>      private: \>           GeAutoDynamicArray<DialogClassLink\*>lnk; \>       \>      public: \>           ~csDialogClass(); \>           void PushClassLink(DialogClassLink\* obj); //this method is called if this dialog was passed to an object of DialogClassLink \> } \> \> void csDialogClass::PushClassLink(DialogClassLink\* obj) \> { \>      lnk.Push(obj); \> } \> \> csDialogClass::~csDialogClass() \> { \>      for(LONG i=0;i<lnk.count;i++) \>           lnk[i]->Set(NULL); \> } \>

            For example:

            > \> csDialogClassLink\* my_diag = gNew csDialogClassLink; \> \> DialogClassLink \* lnk = gNew DialogClassLink; \> lnk->SetLink(my_diag); \> my_diag.PushClassLink(lnk); \> \> gDelete(my_diag); \> \> csDialogClassLink\* is_alive = (csDialogClassLink\* )lnk->Get();   //returns NULL because deconstructor sets 'lnk' member to NULL. \> \>

            The dialog sets all members of DialogClassLinks to NULL which are connected to 'this'. I don't know if its the best way, but for me it works. If you hae any questions, critics or comments, please let me know.

            Cheers, Seb.

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