We recommend using Visual Studio 2017



The latest version of this topic can be found at implements_category.

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 toclass, struct
Required attributesOne of the following: coclass, progid, or vi_progid
Invalid attributesNone

For more information, see Attribute Contexts.

COM Attributes
Class Attributes
Attributes Samples