COM_INTERFACE_ENTRY2

COM_INTERFACE_ENTRY2( x, x2 )

Parameters

x

[in] The name of an interface you want to expose from your object.

x2

[in] The name of the inheritance branch from which x is exposed.

Remarks

Use this macro to disambiguate two branches of inheritance. For example, if you derive your class object from two dual interfaces, you expose IDispatch using COM_INTERFACE_ENTRY2 since IDispatch can be obtained from either one of the interfaces.

For example, from the ATL sample COMMAP:

class COuter :
   public CChainBase, // CChainBase derives from 
                      // IDispatch
   public IDispatchImpl<IOuter, &IID_IOuter, 
                        &LIBID_COMMAPLib)>,
   public CComCoClass<COuter, &CLSID_COuter>
{
public:
   COuter(){}
   ...

   BEGIN_COM_MAP(COuter)
      COM_INTERFACE_ENTRY2(IDispatch, IOuter)
   ...
   END_COM_MAP

};

See COM_INTERFACE_ENTRY Macros for remarks about COM map entries.

ATL Macros and Global Functions