How to change name of coclass ?
-
Hi Folks, I am writing an Attributed COM component in Visual C++ 7.1. In standard cases, the name of the coclass is the same as the CLASS name. I want to know if it is possible to change the coclass name ? For instance, in the following code of mine, IDL will be generated with the coclass named as "CMyData". But, I want to have the coclass name as "MyData" without changing the actual class name. [CODE] [ object, uuid("19088A64-4E82-4FD7-A8A5-A9FEE2577FE8"), dual, helpstring("IMyData Interface"), pointer_default(unique) ] __interface IMyData : IDispatch { [id(1), helpstring("method MyMethod")] HRESULT MyMethod(); } [ coclass, threading("apartment"), support_error_info("IMyData"), vi_progid("MyComponent.MyData"), progid("MyComponent.MyData.1"), version(1.0), uuid("4AF80BC4-6A51-4E83-A3A0-9184230CD2AD"), helpstring("MyData Class") ] class ATL_NO_VTABLE CMyData : public IMyData { public: CMyData(); virtual CMyData(); DECLARE_PROTECT_FINAL_CONSTRUCT() HRESULT FinalConstruct() { return S_OK; } void FinalRelease() { } STDMETHOD(MyMethod)(void); } [/CODE] Any help would be appreciated. Regards, Arun.