| < Free Open Study > |
|
Learn to implement interfaces using nested classes.
Resolve interface method name clashes.
Examine alternative ATL COM map macros.
Understand "tear-off" interfaces and how to implement them.
Build coclasses using COM containment.
Build coclasses using COM aggregation.
As you know, a COM object expresses itself through QueryInterface(). Typically your implementation of this method will simply check the incoming REFIID and return a vTable pointer if the interface is supported. To support each implemented interface, most coclasses developed using C++ make use of public multiple inheritance (MI). Another interface implementation technique is the use of nested classes, which as we will see, can be very helpful when resolving interface method name clashes.
Beyond multiple inheritance and nested classes, COM does allow for a number of interesting identity tricks that C++ developers can employ to develop more sophisticated coclasses. In this chapter we will examine a number of these COM identity tricks, and see how ATL offers a helping hand by way of a number of additional COM map macros, beyond the de facto COM_INTERFACE_ENTRY.
| < Free Open Study > |
|