Partilhar via


DECLARE_OBJECT_DESCRIPTION

Allows you to specify a text description for your class object.

DECLARE_OBJECT_DESCRIPTION( 
   x  
)

Parameters

  • x
    [in] The class object's description.

Remarks

ATL enters this description into the object map through the OBJECT_ENTRY macro.

DECLARE_OBJECT_DESCRIPTION implements a GetObjectDescription function, which you can use to override the CComCoClass::GetObjectDescription method.

The GetObjectDescription function is called by IComponentRegistrar::GetComponents. IComponentRegistrar is an Automation interface that allows you to register and unregister individual components in a DLL. When you create a Component Registrar object with the ATL Project Wizard, the wizard will automatically implement the IComponentRegistrar interface. IComponentRegistrar is typically used by Microsoft Transaction Server.

For more information about the ATL Project Wizard, see the article Creating an ATL Project.

Example

class ATL_NO_VTABLE CMyDescribedClass :
   public CComObjectRoot,
   public CComCoClass<CMyDescribedClass, &CLSID_MyDescribedClass>
{
public:
   CMyDescribedClass()
   {
   }

   // Override CComCoClass::GetObjectDescription
   DECLARE_OBJECT_DESCRIPTION("My Described Object 1.0")
};

Requirements

Header: atlcom.h

See Also

Other Resources

Object Map Macros

ATL Macros