| title |
requires_category | Microsoft Docs |
| ms.custom |
|
| ms.date |
11/04/2016 |
| ms.reviewer |
|
| ms.suite |
|
| ms.technology |
|
| ms.tgt_pltfrm |
|
| ms.topic |
language-reference |
| f1_keywords |
vc-attr.requires_category |
|
| dev_langs |
|
| helpviewer_keywords |
requires_category attribute |
|
| ms.assetid |
a645fdc6-1ef5-414d-8c56-5fe2686d4687 |
| caps.latest.revision |
10 |
| author |
mikeblome |
| ms.author |
mblome |
| manager |
ghogen |
| translation.priority.ht |
cs-cz |
de-de |
es-es |
fr-fr |
it-it |
ja-jp |
ko-kr |
pl-pl |
pt-br |
ru-ru |
tr-tr |
zh-cn |
zh-tw |
|
Specifies the required component categories of the target class.
[ requires_category(
requires_category
) ]
requires_category
The ID of the required category.
Remarks
The requires_category C++ attribute specifies the component categories required by the target class. For more information, see REQUIRED_CATEGORY.
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.
The following code requires that the object implement the Control category.
// cpp_attr_ref_requires_category.cpp
// compile with: /LD
#define _ATL_ATTRIBUTES
#include "atlbase.h"
#include "atlcom.h"
[module (name="MyLibrary")];
[ coclass, requires_category("CATID_Control"),
uuid("1e1a2436-f3ea-4ff3-80bf-5409370e8144")]
class CMyClass {};
|
|
| Applies to |
class, struct |
| Repeatable |
No |
| Required attributes |
One or more of the following: coclass, progid, or vi_progid. |
| Invalid attributes |
None |
For more information about the attribute contexts, see Attribute Contexts.
COM Attributes
implements_category