THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 30/04/2009 at 03:50, xxxxxxxx wrote:
yes i did it in plugin start, not sure though what you mean with priorities. Do i have to change sth in the PluginMessage() part ?
heres my complete main.cpp, which is based on the 9.6 sdk. My generator code is based on the atom.cpp example.
> <code>
> #include "c4d.h"
> #include <string.h>
>
> // forward declarations
> Bool RegisterPluginX(); // tool plugin
> Bool RegisterPluginY(); // generator plugin
>
>
> Bool PluginStart(void){
>
> if (!RegisterPluginX()){
> GePrint("failed to register PluginX!");
> return FALSE;
> }
> if (!RegisterPluginY()){
> GePrint("failed to register PluginY!");
> return FALSE;
> }
>
> return TRUE;
> }
>
> void PluginEnd(void){
> }
>
> Bool PluginMessage(LONG id, void *data){
> //use the following lines to set a plugin priority
> //
> switch (id)
> {
> case C4DPL_INIT_SYS:
> if (!resource.Init()) return FALSE; // don't start plugin without resource
> //if (!RegisterExampleDataType()) return FALSE;
> return TRUE;
>
> case C4DMSG_PRIORITY:
> return TRUE;
>
> case C4DPL_BUILDMENU:
> //EnhanceMainMenu();
> break;
>
> case C4DPL_COMMANDLINEARGS:
> {
> C4DPL_CommandLineArgs *args = (C4DPL_CommandLineArgs* )data;
> LONG i;
>
> for (i=0;i<args->argc;i++){
> if (!args->argv _) continue;
>
> if (!strcmp(args->argv _,"--help") || !strcmp(args- >argv _,"-help")){
> // do not clear the entry so that other plugins can make their output!!!
> GePrint("\x01-SDK is here :-)");
> }
> else if (!strcmp(args->argv _,"-SDK")) {
> args->argv _= NULL;
> GePrint("\x01-SDK executed:-)");
> }
> else if (!strcmp(args->argv _,"-plugincrash")){
> args->argv _= NULL;
> *((LONG* )0) = 1234;
> }
> }
> }
> break;
>
> case C4DPL_EDITIMAGE:
> {
> C4DPL_EditImage *editimage = (C4DPL_EditImage* )data;
> if (!data) break;
> if (editimage->return_processed) break;
> GePrint("C4DSDK - Edit Image Hook: "+editimage->imagefn->GetString());
> // editimage->return_processed = TRUE; if image was processed
> }
> return FALSE;
> }
>
> return FALSE;
> }
> </code>
there's no error msg in the console, so the plugin was registered correctly, just too late i guess..