Summary
COM has abstractions much like those of the C++
standard library. Collections maintain lists of things, often
objects. Enumerators enable navigation over the list of things
maintained in a collection. To standardize access to collections
and enumerators, they have a standard protocol. These standards
aren't required, but if they are followed, they make an object
model programmer's life easier because the usage is familiar.
Implementing an object model is a matter of defining the
higher-level object, the lower-level object, and the collection
that joins the two. ATL implements both collection and enumeration
interfaces, if you're not afraid of the type definitions required
to make it all work.
|