Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
ATL
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

COM_INTERFACE_ENTRY_TEAR_OFF

Exposes your tear-off interfaces.

COM_INTERFACE_ENTRY_TEAR_OFF( iid, x )

iid

[in] The GUID of the tear-off interface.

x

[in] The name of the class implementing the interface.

A tear-off interface is implemented as a separate object that is instantiated every time the interface it represents is queried for. Typically, you build your interface as a tear-off if the interface is rarely used, since this saves a vtable pointer in every instance of your main object. The tear-off is deleted when its reference count becomes zero. The class implementing the tear-off should be derived from CComTearOffObjectBase and have its own COM map.

See COM_INTERFACE_ENTRY Macros for remarks about COM map entries.

BEGIN_COM_MAP(CBeeper)
   COM_INTERFACE_ENTRY(IBeeper)
   COM_INTERFACE_ENTRY(IDispatch)
   COM_INTERFACE_ENTRY_TEAR_OFF(IID_ISupportErrorInfo, CBeeper2)
END_COM_MAP()

Header: atlcom.h

Community Additions

ADD
Show:
© 2015 Microsoft