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

    SNHook not working

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 380 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 03/11/2012 at 17:37, xxxxxxxx wrote:

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

      ---------
      Hey Guys,

      I want to protect my plugin so I use the SNHook.
      Cinema ask for serial, all fine. But if the serial is wrong and i click cancel, the plugin is still loaded?!?

      I tried it at R13 and my mate in R14. What do I wrong?

        
      //-----------------------------------------------------------------------------------------------------------------------------------------------------------//  
      LONG RoomMakerSNHook::SNCheck(const String &c4dsn,const String &sn,LONG regdate,LONG curdate)  
      //-----------------------------------------------------------------------------------------------------------------------------------------------------------//  
      {      
        return SN_WRONGNUMBER;  
      }  
      
        
      case C4DPL_INIT_SYS:  
                if (!resource.Init()) return FALSE; // don't start plugin without resource  
        
                // serial hook example; if used must be registered before PluginStart(), best in C4DPL_INIT_SYS  
                if (!RegisterExampleSNHook()) return FALSE;  
      

      Nothing, it still load my objectData !?

      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 04/11/2012 at 01:29, xxxxxxxx wrote:

        Returning FALSE from PluginMessage() when C4DPL_INIT_SYS is sent does not prevent Cinema to call PluginStart(). Ask your SNHook subclass instance if it registration was successful.

        -Niklas

        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 04/11/2012 at 03:51, xxxxxxxx wrote:

          My Subclass?

          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 04/11/2012 at 05:33, xxxxxxxx wrote:

            RoomMakerSNHook is your subclass of the SNHook class, isn't it?

            LONG RoomMakerSNHook::SNCheck(const String &c4dsn,const String &sn,LONG regdate,LONG curdate) {  
              Bool registration_successful = FALSE;  
              /* ... */  
              this->success = registration_successful;  
              if (!registration_successful) return SN_WRONGNUMBER;  
              else return SN_OKAY;  
            }  
              
            Bool RoomMakerSNHook::Success() {  
              return this->success;  
            }  
              
            /* ... */  
              
            RoomMakerSNHook snhook;  
              
            Bool PluginStart() {  
              if (!snhook->Success()) return TRUE;  
              /* Register your plugins. */  
            }  
              
            Bool PluginMessage(LONG id, void* ptr) {  
              switch (id) {  
                  case C4DPL_INIT_SYS:  
                      /* Register SNHook and etc. */  
                      break;  
              }  
              return TRUE;  
            }
            

            That's how I was doin' it. Maybe I missed something obvious. But it works.

            Cheers,

            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 05/11/2012 at 01:11, xxxxxxxx wrote:

              All right. Thank you. 🙂

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