Colliding ID



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

    On 24/01/2008 at 03:08, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   R10.1 
    Platform:      
    Language(s) :     C++  ;

    ---------
    Hello,
    Here is my problem :
    I'm tying to write a plugin object (objectData). All is normal, I put my compiled file in the plugin directory and that work. But if I want to write a second plugin, ID collides :

    _<_img border="0" src= "http://ykoeth.free.fr/fc4d/console_id.jpg"_>_

    The main.cpp of the plugin1 :

    > _
    > // Starts the plugin registration
    >
    > #include "c4d.h"
    >
    >
    > // forward declarations
    > Bool RegisterPlugin1(void);
    >
    >
    > Bool PluginStart(void)
    > {
    >      
    >      if (!RegisterPlugin1()) 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
    >                return TRUE;
    >
    >           case C4DMSG_PRIORITY:
    >                return TRUE;
    >
    >      }
    >
    >      return FALSE;
    > }
    >
    > _

    plugin1.cpp :

    > _
    > #include "c4d.h"
    >
    > class Plugin1 : public ObjectData
    > {
    >      
    >      public:
    >           virtual Bool Init(GeListNode *node);
    >
    >           virtual Bool Message                    (GeListNode *node, LONG type, void *data);
    >           virtual BaseObject* GetVirtualObjects(BaseObject* op, HierarchyHelp* hh);
    >           static NodeData *Alloc(void) { return gNew Plugin1; }
    > };
    >
    > Bool Plugin1::Message(GeListNode *node, LONG type, void *data)
    > {
    >      return TRUE;
    > }
    >
    >
    > Bool Plugin1::Init(GeListNode *node)
    > {     
    >      return TRUE;
    > }
    >
    > BaseObject* Plugin1::GetVirtualObjects(BaseObject* op, HierarchyHelp* hh)
    > {
    >      
    >      BaseObject *ret = NULL;
    >      return ret;
    > }
    > // be sure to use a unique ID obtained from www.plugincafe.com
    > #define ID_PLUGIN1 1000004
    >
    > Bool RegisterPlugin1(void)
    > {
    >      return RegisterObjectPlugin(ID_PLUGIN1,"plugin1 name",OBJECT_GENERATOR,Plugin1::Alloc,"plugin1",NULL,0);
    > }
    >
    > _

    The main.cpp of the plugin2 :

    > _
    > // Starts the plugin registration
    >
    > #include "c4d.h"
    >
    >
    > // forward declarations
    > Bool RegisterPlugin2(void);
    >
    >
    > Bool PluginStart(void)
    > {
    >      
    >      if (!RegisterPlugin2()) 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
    >                return TRUE;
    >
    >           case C4DMSG_PRIORITY:
    >                return TRUE;
    >
    >      }
    >
    >      return FALSE;
    > }
    >
    > _

    plugin2.cpp :

    > _
    > #include "c4d.h"
    >
    > class Plugin2 : public ObjectData
    > {
    >      
    >      public:
    >           virtual Bool Init(GeListNode *node);
    >
    >           virtual Bool Message                    (GeListNode *node, LONG type, void *data);
    >           virtual BaseObject* GetVirtualObjects(BaseObject* op, HierarchyHelp* hh);
    >           static NodeData *Alloc(void) { return gNew Plugin2; }
    > };
    >
    > Bool Plugin2::Message(GeListNode *node, LONG type, void *data)
    > {
    >      return TRUE;
    > }
    >
    >
    > Bool Plugin2::Init(GeListNode *node)
    > {     
    >      return TRUE;
    > }
    >
    > BaseObject* Plugin2::GetVirtualObjects(BaseObject* op, HierarchyHelp* hh)
    > {
    >      
    >      BaseObject *ret = NULL;
    >      return ret;
    > }
    > // be sure to use a unique ID obtained from www.plugincafe.com
    > #define ID_PLUGIN2 1000006
    >
    > Bool RegisterPlugin2(void)
    > {
    >      return RegisterObjectPlugin(ID_PLUGIN2,"plugin2 name",OBJECT_GENERATOR,Plugin2::Alloc,"plugin2",NULL,0);
    > }
    >
    > _

    I don't why because IDs are different.
    I hope somebody have the solution,
    Thank you.



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

    On 24/01/2008 at 08:15, xxxxxxxx wrote:

    Or if somebody can give me a file with the source code of a simple plugin (or two simples plugins) like mine but as you would have coded it. Thank



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

    On 24/01/2008 at 08:27, xxxxxxxx wrote:

    Sorry, I found alone. It was the products names which were the sames.
    The solution : Xcode>Project>Project Settings>Product name.
    Sorry for this inconvenience.


Log in to reply