We recommend using Visual Studio 2017

implements_category

 

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

Specifies the component categories implemented by the target class.

  
      [ implements_category(  
   implements_category="uuid"  
) ]  

Parameters

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  
#define _ATL_ATTRIBUTES  
#include "atlbase.h"  
#include "atlcom.h"  
  
[module (name="MyLib")];  
[ coclass, implements_category("CATID_Control"),  
  uuid("20a0d0cc-5172-40f5-99ae-5e032f3205ae")]  
class CMyClass {};  

Attribute Context

Applies toclass, struct
RepeatableYes
Required attributesOne of the following: coclass, progid, or vi_progid
Invalid attributesNone

For more information, see Attribute Contexts.

COM Attributes
Class Attributes
IMPLEMENTED_CATEGORY
Attributes Samples

Show: