The CDO for Windows 2000Object Model

Figure 12-2 shows the object model diagram for CDO for Windows 2000.

The CDO for Windows 2000 object model

Figure 12-2. The CDO for Windows 2000 object model

The format of the CDO for Windows 2000 object model diagram is a little different from the format of other object model diagrams in this book. Whereas typical object model diagrams focus on expressing relationships among classes, the CDO for Windows 2000 object model diagram also must express relationships among interfaces, because in this object model, interfaces play an important role.

An interface is the set of methods and properties exposed by a class. A developer using a class written by another developer needs to know the class’s interface in order to call methods and use properties appropriately. This is simple so far, but it gets complicated. COM classes can expose more than one interface. It’s up to the caller to ask for the interface that it wants to use before calling a method or accessing a property that is part of that interface. If the caller then wants to call a method that’s part of a different interface, it must ask the object for that different interface before making the call. A class can designate one of its interfaces to be its default interface. The default interface is used when an object is instantiated and used without explicitly specifying an interface. This is the typical usage in Visual Basic.

Get CDO & MAPI Programming with Visual Basic: now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.