PluginMessage(), SNHook, ReadPluginInfo()



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

    On 30/04/2008 at 13:03, xxxxxxxx wrote:

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

    ---------
    My general question is when/if ReadPluginInfo() might be available/valid to call in during the plugin startup process...
    More specifically, I'd like to know if it's ok to call ReadPluginInfo() from inside the SNHookClass::SNCheck() method.  My SNHookClass-derived class is being registered when my PluginMessage() code recieves a C4DPL_INIT_SYS message, but it's not clear to me exactly when the SNCheck() is being called, although I deduce that it's sometime after registering my hook and before calling my PluginStart().
    On a similar and potentially related note, I am also now doing the resource.Init() just prior to registering the hook (on that C4DPL_INIT_SYS message), so that much is taken care of... I just need to know if it's ok to call ReadPluginInfo() from within SNCheck().
    Thanks,
    Keith



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

    On 01/05/2008 at 00:49, xxxxxxxx wrote:

    Hmmm... looks like the question may be moot.  Apparently, the serial number for your plugin IS STORED IN THE SAME PLACE Read/WritePluginInfo() USES...
    I guess I was just being dense, but when the SDK docs for ReadPluginInfo() says: "Read private serial information for a plugin." - it means it literally (same thing for WritePluginInfo()) - the plugin serial number passed to a SNHookClass::SNCheck() method is a String() stored there.
    Since I had been saving a structure-worth of some other data there in earlier compiles (I'm just now implementing the SNHook method), it didn't occur to me that the SDK doc text above was literal.
    Anyway, I guess that answers my initial question above (apparently ReadPluginInfo() would be a valid thing to do at that time within the startup), as well as answering the question of why I'm not getting a '0' regdate passed to my SNHook::SNCheck() method (I always get a '1' - which shouldn't normally happen, but I had other random data already stored with WritePluginInfo() for that PluginID).
    Just to clarify... I also just recently discovered the Get/SetWorldPluginData() routines and have switched most of my plugin options type data to use those instead, so I just need to fix this last remaining one.
    Suggestion for the SDK docs... have the docs for each of the above routines mention the others (ie. WritePluginInfo() docs should tell you about SetWorldPluginData() and visa-versa).



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

    On 01/05/2008 at 01:03, xxxxxxxx wrote:

    ...which I guess changes my initial question to:
    Can I (safely) call Get/SetWorldPluginData() from my SNHook-derived class' SNCheck() method? ;)


Log in to reply