Exportar (0) Imprimir
Expandir todo
ATL
Expandir Minimizar

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.

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 more information, see Implementing the IDispatch Interface.

See COM_INTERFACE_ENTRY Macros for remarks about COM map entries.

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

};

Adiciones de comunidad

AGREGAR
Mostrar:
© 2014 Microsoft