Thursday, December 16, 2004

Adobe SDK - plugin conflict

I had a problem with an InDesign plugin I was developing lately, the problem occours when you run InDesign and InDesign tell you that the plugin will conflicts with itself.
After a lot of tries (the plugin was pretty empty) I found out that the problem was a command that was something like:

Class
{
kSampleCmdBoss,
kInvalidClass,
{
IID_ICOMMAND, kSampleCmdImpl,
IID_ISTRINGDATA, kStringDataImpl,
IID_ISAMPLENAMEDATA, kStringDataImpl,
}
},

The culprit is the IID_ISAMPLENAMEDATA, it seems like a commands cannot have two standard kStringDataImpl, so the solution is to replace the second kStringDataImpl, to do this we need to simply define an implementation alias like this:


resource ImplementationAlias(1)
{
{
kSampleNameDataImpl, kStringDataImpl,
}
};


so now we can modify our command in this way:

Class
{
kSampleCmdBoss,
kInvalidClass,
{
IID_ICOMMAND, kSampleCmdImpl,
IID_ISTRINGDATA, kStringDataImpl,
IID_ISAMPLENAMEDATA, kSampleNameDataImpl,
}
},


and don't forget to add the kSampleNameDataImpl implementation if the xxxID.h


No comments: