substituez la méthode GetProgID de l'usine. Quelque chose le long des lignes de ce qui suit devrait faire:
template <typename T>
class TMyCppComObjectFactory : public TCppComObjectFactory<T>
{
protected:
System::UnicodeString __fastcall GetProgID()
{
return "Company.ProgName.Functionality";
}
public:
__fastcall TMyCppComObjectFactory(Comobj::TComServerObject* ComServer,
Comobj::TComClass ComClass,
const GUID &ClassID,
const System::String ClassName,
const System::String Description,
Comobj::TClassInstancing Instancing,
Comobj::TThreadingModel ThreadingModel) :
TCppComObjectFactory<T>(ComServer, ComClass, ClassID,
ClassName, Description,
Instancing, ThreadingModel)
{
}
};
Puis ont le createFactory() du serveur COM utiliser l'usine dérivée.
Cheers,
Bruneau
Merci, testeront dans la prochaine temps et cochez la réponse comme correcte si cela fonctionne. –