Skip to content

Latest commit

 

History

History
50 lines (45 loc) · 1.78 KB

File metadata and controls

50 lines (45 loc) · 1.78 KB
title Implementing CComObjectRootEx | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-windows
ms.tgt_pltfrm
ms.topic article
f1_keywords
CComObjectRootEx
dev_langs
C++
helpviewer_keywords
CComObjectRoot class, implementing
CComObjectRootEx class
ms.assetid 79630c44-f2df-4e9e-b730-400a0ebfbd2b
caps.latest.revision 13
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

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