Fundamentals of ATL COM Objects
The following illustration depicts the relationship among the various classes and interfaces used in defining an ATL COM object.
ATL implements IUnknown in two phases:
CComObject, CComAggObject, or CComPolyObject implements the IUnknown methods.
CComObjectRoot or CComObjectRootEx manages the reference count and outer pointers of IUnknown.
Other aspects of your ATL COM object are handled by other classes:
CComCoClass defines the object's default class factory and aggregation model.
IDispatchImpl provides a default implementation of the IDispatch Interface portion of any dual interfaces on the object.
ISupportErrorInfoImpl implements the ISupportErrorInfo interface that ensures error information can be propagated up the call chain correctly.
In This Section
Implementing CComObjectRootEx
Show example COM map entries for implementing CComObjectRootEx.Implementing CComObject, CComAggObject, and CComPolyObject
Discusses how the DECLARE_*_AGGREGATABLE macros affect the use of CComObject, CComAggObject, and CComPolyObject.Supporting IDispatch and IErrorInfo
Lists the ATL implementation classes to use for supporting the IDispatch and IErrorInfo interfaces.Supporting IDispEventImpl
Discusses the steps to implement a connection point for your class.Changing the Default Class Factory and Aggregation Model
Show what macros to use to change the default class factory and aggregation model.Creating an Aggregated Object
Lists the steps for creating an aggregated object.
Related Sections
Creating an ATL Project
Provides information about creating an ATL COM object.ATL
Provides links to conceptual topics on how to program using the Active Template Library.