Chapter 11: COM Enumerators and COM Collections

 < Free Open Study > 



Objectives:

  • Examine a number of techniques for returning complex data to COM clients.

  • Understand COM enumerators.

  • Examine ATL's support for COM enumeration.

  • Build a static and dynamic COM collection.

  • Understand ATL's support for COM collections.

We have already seen how COM object "A" can contain a single COM object "B" (just have the outer object call CoCreateInstance() on the inner object). However, we have not examined how a given object can contain a collection of objects, which may be obtained by the client in a standard fashion. COM provides a mythical interface named IEnumXXXX that allows a client a fixed way to "pull" a batch of items from a coclass, rather than asking for an item one at a time. This pattern is termed COM enumeration, and in this chapter we will examine how to build such an object container.

We then investigate a COM collection, which is (in essence) a language-neutral variation on the COM enumeration pattern. We also examine some of the templates provided by the ATL framework to help build COM enumerators and collections, and see how COM clients can manipulate their contents.



 < 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