Demo Plugin Version.

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

On 12/02/2010 at 08:58, xxxxxxxx wrote:

Originally posted by xxxxxxxx

if (GeGetVersionType() == VERSION_SAVABLEDEMO || VERSION_SAVABLEDEMO_ACTIVE)

Hi,

in any case you should use GeGetVersionType() & VERSION_SAVABLEDEMO.  Not == because the returned LONG value is considered a bit field in this case not directly a digit (though it of course will still work but you are on the safe side this way).

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

On 12/02/2010 at 09:00, xxxxxxxx wrote:

oh.. right .. thanks Katachi.

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

On 13/02/2010 at 06:02, xxxxxxxx wrote:

Okay so I tried this in the main.cpp..

  
Bool PluginStart(void)  
{  
  // example of installing a crashhandler  
  old_handler = C4DOS.CrashHandler; // backup the original handler (must be called!)  
  C4DOS.CrashHandler = SDKCrashHandler; // insert the own handler  
  //GePrint("PLANET X GENERATOR IS AVAILABLE FOR DEMO USE ONLY!");  
    
      if (GeGetVersionType() &VERSION_SAVABLEDEMO_ACTIVE || VERSION_SAVABLEDEMO || VERSION_DEMO)  
      {  
          GePrint("PLANET X GENERATOR IS AVAILABLE FOR DEMO USE ONLY!");  
      }  
  
      else  
      {  
          GePrint("NOT THE DEMO");  
          GePrint("THE VERSION TYPE IS " + LongToString(GeGetVersionType()));  
          if (!IsSerialOKHook()) return FALSE; //don't load plugins if key is wrong      
      }  
  
  // Planet Object  
  if (!RegisterPlanet()) return FALSE;  
  // Sun Object  
  if (!RegisterSun()) return FALSE;  
  // Space Object  
  if (!RegisterSpace()) return FALSE;  
  //SERIAL NUMBER  
  if (!RegisterPlanetXSerial()) return FALSE;  
  
  return RegisterPlanet() && RegisterSun() && RegisterSpace();  
}  
  

When I am in the demo mode I get the plugin enabled and I am able to use it and as expected, the console prints out....

PLANET X GENERATOR IS AVAILABLE FOR DEMO USE ONLY!

However, when I am using my registered copy of the plugin, I am also able to use it and the console prints out...

PLANET X GENERATOR IS AVAILABLE FOR DEMO USE ONLY!

Why do you think this is happening?

~Shawn

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

On 13/02/2010 at 07:01, xxxxxxxx wrote:

Well...  thanks to a heaping helping of kindness from Cactus Dan,  this problem has been solved.   Here's the final working code for the PluginStart();

  
Bool PluginStart(void)  
{  
  // example of installing a crashhandler  
  old_handler = C4DOS.CrashHandler; // backup the original handler (must be called!)  
  C4DOS.CrashHandler = SDKCrashHandler; // insert the own handler  
  //GePrint("PLANET X GENERATOR IS AVAILABLE FOR DEMO USE ONLY!");  
    
      if(GeGetVersionType()&VERSION_SAVABLEDEMO_ACTIVE || GeGetVersionType()&VERSION_SAVABLEDEMO || GeGetVersionType()&VERSION_DEMO)  
      {  
          GePrint("PLANET X GENERATOR IS AVAILABLE FOR DEMO USE ONLY!");  
      }  
  
      else  
      {  
          GePrint("NOT THE DEMO");  
          GePrint("THE VERSION TYPE IS " + LongToString(GeGetVersionType()));  
          if (!IsSerialOKHook()) return FALSE; //don't load plugins if key is wrong      
      }  
  
  // Planet Object  
  if (!RegisterPlanet()) return FALSE;  
  // Sun Object  
  if (!RegisterSun()) return FALSE;  
  // Space Object  
  if (!RegisterSpace()) return FALSE;  
  //SERIAL NUMBER  
  if (!RegisterPlanetXSerial()) return FALSE;  
  
  return RegisterPlanet() && RegisterSun() && RegisterSpace();  
}  

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

On 13/02/2010 at 07:31, xxxxxxxx wrote:

The line looks strange to me:

GeGetVersionType() &VERSION;_SAVABLEDEMO_ACTIVE || VERSION_SAVABLEDEMO || VERSION_DEMO

Shouldn't it be:

GeGetVersionType() == VERSION_SAVABLEDEMO_ACTIVE || VERSION_SAVABLEDEMO || VERSION_DEMO

[EDIT]Oh no, wait. Forget about this. & is correct.[/EDIT]

Cheers,
Jack

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

On 13/02/2010 at 07:33, xxxxxxxx wrote:

Actually, that looks strange to me, too:

    // Planet Object   
    if (!RegisterPlanet()) return FALSE;   
    // Sun Object   
    if (!RegisterSun()) return FALSE;   
    // Space Object   
    if (!RegisterSpace()) return FALSE;   
    //SERIAL NUMBER   
    if (!RegisterPlanetXSerial()) return FALSE;   
  
    return RegisterPlanet() && RegisterSun() && RegisterSpace();   

So, you first try to register the plugins. When this succeeds, you register them all again and return the result? Why don't you just return TRUE at the end of the function, since they're already registered?

Cheers,
Jack

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

On 13/02/2010 at 07:45, xxxxxxxx wrote:

so instead of

return RegisterPlanet() && RegisterSun() && RegisterSpace();  

do...

return TRUE;  

?

~Shawn

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

On 13/02/2010 at 09:53, xxxxxxxx wrote:

GeGetVersionType() returns a bit mask. So you have to check against your own bit mask.

Remember that || and & & are compare operators.
| and & are bit mask operators.

Following line of code checks if the result of GeGetversionType() has one of the specified bits set.

  
if (GeGetVersionType() & (VERSION_SAVABLEDEMO_ACTIVE | VERSION_SAVABLEDEMO | VERSION_DEMO))  
{  
  //do something  
}  

cheers,
Matthias

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

On 13/02/2010 at 14:57, xxxxxxxx wrote:

Originally posted by xxxxxxxx

so instead of

return RegisterPlanet() && RegisterSun() && RegisterSpace();
do...

return TRUE;
?

Yes. You have already called all Register functions before, so if the function reaches this point, you can just return TRUE. If one of the Register functions does not work out (returns FALSE) the PluginStart function is cancelled anyway and FALSE is returned.

Cheers,
Jack

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

On 15/02/2010 at 02:00, xxxxxxxx wrote:

Originally posted by xxxxxxxx

And what is the exact dependency? From R11 on checking for these two instead of VERSON_DEMO? Is VERSON_DEMO completely gone now or should one still check for it? Thanks

VERSION_DEMO is not used anymore since the R11 demo version.

cheers,
Matthias

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

On 15/02/2010 at 02:07, xxxxxxxx wrote:

Originally posted by xxxxxxxx

hmm, it seems to me that the demo does not call SNCheck at all. Is that right?

The demo version doesn't support the SNHookClass because it has no Personalioze dialog anyway.

Check in C4DPL_INIT_SYS for the Cinema version (that's where you would register the SNHookClass too).

cheers,
Matthias

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

On 15/02/2010 at 04:18, xxxxxxxx wrote:

Thanks Matthias.