Partilhar via


COM_INTERFACE_ENTRY2

Use this macro to disambiguate two branches of inheritance.

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

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.

See COM_INTERFACE_ENTRY Macros for remarks about COM map entries.

Example

class ATL_NO_VTABLE CEntry2Example :
   public CEntry2ExampleBase, // CEntry2ExampleBase derives from IDispatch
   public IDispatchImpl<IEntry2Example, &IID_IEntry2Example, &LIBID_NVC_ATL_WindowingLib, /*wMajor =*/ 1, /*wMinor =*/ 0>,
   public CComCoClass<CEntry2Example, &CLSID_Entry2Example>
{
public:
   CEntry2Example()
   {
   }

BEGIN_COM_MAP(CEntry2Example)
   COM_INTERFACE_ENTRY(IEntry2Example)
   COM_INTERFACE_ENTRY2(IDispatch, IEntry2Example)
END_COM_MAP()
};

Requirements

Header: atlcom.h

See Also

Other Resources

COM Map Macros

ATL Macros