Partilhar via


REQUIRED_CATEGORY

Add a REQUIRED_CATEGORY macro to your component's category map to specify that it should be registered as requiring the category identified by the catID parameter.

REQUIRED_CATEGORY( 
   catID  
)

Parameters

  • catID
    [in] A CATID constant or variable holding the globally unique identifier (GUID) for the required category. The address of catID will be taken and added to the map. See the table below for a selection of stock categories.

Remarks

The component categories listed in the map will be registered automatically when the module is registered if the class has an associated OBJECT_ENTRY_AUTO or OBJECT_ENTRY_NON_CREATEABLE_EX_AUTO macro.

Clients can use the category information registered for the class to determine its capabilities and requirements without having to create an instance of it. For example, a control may require that a container support data binding. The container can find out if it has the capabilities necessary to host the control by querying the category manager for the categories required by that control. If the container does not support a required feature, it can refuse to host the COM object.

For more information about component categories, including a sample list, see What are Component Categories and how do they work? in the Windows SDK.

A Selection of Stock Categories

Description

Symbol

Registry GUID

Safe For Scripting

CATID_SafeForScripting

{7DD95801-9882-11CF-9FA9-00AA006C42C4}

Safe For Initialization

CATID_SafeForInitializing

{7DD95802-9882-11CF-9FA9-00AA006C42C4}

Simple Frame Site Containment

CATID_SimpleFrameControl

{157083E0-2368-11cf-87B9-00AA006C8166}

Simple Data Binding

CATID_PropertyNotifyControl

{157083E1-2368-11cf-87B9-00AA006C8166}

Advanced Data Binding

CATID_VBDataBound

{157083E2-2368-11cf-87B9-00AA006C8166}

Windowless Controls

CATID_WindowlessObject

{1D06B600-3AE3-11cf-87B9-00AA006C8166}

Internet-Aware Objects

See Internet Aware Objects in the Windows SDK for a sample list.

 

Example

BEGIN_CATEGORY_MAP(CMyWindow)
   REQUIRED_CATEGORY(CATID_InternetAware)
END_CATEGORY_MAP()

Requirements

Header: atlcom.h

See Also

Reference

BEGIN_CATEGORY_MAP

IMPLEMENTED_CATEGORY

END_CATEGORY_MAP

Other Resources

Category Macros

ATL Macros