Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 1.37 KB

implementing-ccomobjectrootex.md

File metadata and controls

21 lines (15 loc) · 1.37 KB
description title ms.date helpviewer_keywords ms.assetid
Learn more about: Implementing CComObjectRootEx
Implementing CComObjectRootEx
11/04/2016
CComObjectRoot class, implementing
CComObjectRootEx class
79630c44-f2df-4e9e-b730-400a0ebfbd2b

Implementing CComObjectRootEx

CComObjectRootEx is essential; all ATL objects must have one instance of CComObjectRootEx or CComObjectRoot in their inheritance. CComObjectRootEx provides the default QueryInterface mechanism based on COM map entries.

Through its COM map, an object's interfaces are exposed to a client when the client queries for an interface. The query is performed through CComObjectRootEx::InternalQueryInterface. InternalQueryInterface only handles interfaces in the COM map table.

You can enter interfaces into the COM map table with the COM_INTERFACE_ENTRY macro or one of its variants. For example, the following code enters the interfaces IDispatch, IBeeper, and ISupportErrorInfo into the COM map table:

[!code-cppNVC_ATL_COM#1]

See also

Fundamentals of ATL COM Objects
COM Map Macros