Fundamentals of ATL COM Objects

Fundamentals of ATL COM Objects

The following illustration depicts the relationship among the various classes and interfaces used in defining an ATL COM object.

Fundamentals of ATL COM Objects

ATL implements IUnknown in two phases:

  • CComObjectCComAggObject, 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 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.

你可能感兴趣的:(object)