This documentation is archived and is not being maintained.


Specifies the component categories implemented by the target class.

[ implements_category( 
) ]


The ID of the implemented category.

The implements_category C++ attribute specifies the component categories implemented by the target class. This is done by creating a CATEGORY map and adding separate entries specified by the implements_category attribute. For more information, see What are Component Categories and How Do They Work?.

This attribute requires that the coclass, progid, or vi_progid attribute (or another attribute that implies one of these) also be applied to the same element. If any single attribute is used, the other two are automatically applied. For example, if progid is applied, vi_progid and coclass are also applied.

The following code specifies that the following object implements the Control category.

// cpp_attr_ref_implements_category.cpp
// compile with: /LD
#include "atlbase.h"
#include "atlcom.h"

[module (name="MyLib")];
[ coclass, implements_category("CATID_Control"),
class CMyClass {};

Attribute Context

Applies to

class, struct



Required attributes

One of the following: coclass, progid, or vi_progid

Invalid attributes


For more information, see Attribute Contexts.