Multiple Dual Interfaces

Dual Interfaces and ATL

It is possible to expose multiple dual interfaces on a single object by deriving from two or more specializations of IDispatchImpl. However, if you allow clients to query for the IDispatch interface, you will need to use the COM_INTERFACE_ENTRY2 macro (or COM_INTERFACE_ENTRY_IID) to specify which base class to use for the implementation of IDispatch.

COM_INTERFACE_ENTRY2(IDispatch, IMyDualInterface)

Note that ATL doesn't provide any support for combining multiple dual interfaces into a single implementation of IDispatch. Clients that can only access your objects via the IDispatch interface will not be able to access the methods or properties in any other interface. For this reason, having multiple dual interfaces on a single object rarely makes sense.