Question
Getting a compiler error
Hello All:<br /><br /> I have some code provided to me by Adobe for building a selection suite. In the .FR I have this:<br /><br /> AddIn<br /> {<br /> kIntegratorSuiteBoss,<br /> kInvalidClass,<br /> {<br /> IID_IMYSELECTIONSUITE, kMySelectionSuiteASBImpl,<br /> }<br /> },<br /><br /> AddIn<br /> {<br /> kLayoutSuiteBoss,<br /> kInvalidClass,<br /> {<br /> IID_IMYSELECTIONSUITE, kMySelectionSuiteCSBImpl,<br /> }<br /> },<br /><br />Please assume that all definitions and declarations and PMIDs, etc., have been declared in the appropriate auxiliary files.<br /><br />I copied the files implementing the above verbatim into the project.<br /><br />This is how I instantiate the interface in the code:<br /><br /> ISelectionManager* iSelMgr = ActiveContext -> GetContextSelection();<br /><br /> InterfacePtr<IMySelectionSuite> mySelectionSuite(iSelMgr, UseDefaultIID());<br /><br />The problem is that when I compile the module, I get the following error message:<br /><br />C:\Program Files\Adobe\InDesignCSAndInCopyCSSDK\source\sdksamples\codesnippets\SnpTestSelectionSuite.cpp(178): error C2664: 'InterfacePtr<IFace>::InterfacePtr(const IPMUnknown *,PMIID)' : cannot convert parameter 1 from 'ISelectionManager *' to 'const IPMUnknown *'<br /> with<br /> [<br /> IFace=IMySelectionSuite<br /> ]<br /><br />I can make this disappear by casting iSelMgr to type IPMUnknown, but somehow that doesn't feel right.<br /><br />As far as I can tell, I have the right headers included in the file. Anyone have any suggestions about how to resolve this error message without the ambiguity of using IPMUnknown?