Chapter 8: COM Object Identity and ATL

 < Free Open Study > 



Objectives:

  • 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 > 



Developer's Workshop to COM and ATL 3.0
Developers Workshop to COM and ATL 3.0
ISBN: 1556227043
EAN: 2147483647
Year: 2000
Pages: 171

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net