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:
BEGIN_COM_MAP(CBeeper)
COM_INTERFACE_ENTRY(IBeeper)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY_TEAR_OFF(IID_ISupportErrorInfo, CBeeper2)
END_COM_MAP()
See also
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: Under hela 2024 kommer vi att fasa ut GitHub-problem som feedbackmekanism för innehåll och ersätta det med ett nytt feedbacksystem. Mer information finns i:Skicka och visa feedback för