Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. How to change name of coclass ?

How to change name of coclass ?

Scheduled Pinned Locked Moved COM
c++comhelptutorialquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    arun1405
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups