COM_INTERFACE_ENTRY_TEAR_OFF

COM_INTERFACE_ENTRY_TEAR_OFF( iid, x )

Parameters

iid

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

x

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

Remarks

Exposes your tear-off interfaces. 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.

For example, from the ATL sample COMMAP:

BEGIN_COM_MAP(COuter)
   ...
   COM_INTERFACE_ENTRY_TEAR_OFF(IID_ITearOff1, CTearOff1)
   ...
END_COM_MAP()

See COM_INTERFACE_ENTRY Macros for remarks about COM map entries.

ATL Macros and Global Functions