Definitions and Text Conventions
The following definitions and conventions apply throughout this book:
A component is an implementation of a set of interfaces. A component is what you mark in your IDL file (or type library) with CoClass or a class in C#.
An object is an instance of a component. You can create objects by calling
CoCreateInstance( )in C++, specifying the class ID (the type) of the object you want to create. If you use Visual Basic 6.0, you can create objects usingneworCreateObject( ). A C# client usesnewto create a new instance of a component.I use the following terms in the book: CoCreating refers to calling
CoCreateInstance()in C++, orneworCreateObject( )in Visual Basic. Querying an object for an interface refers to callingIUnknown::QueryInterface( )on the object. Releasing an object refers to callingIUnknown::Release( )on the object.The graphical notations in Figure P-1 are used in almost every design diagram in the book. The “lollipop” denotes an interface, and a method call on an interface is represented by an arrow beginning with a full circle.
Figure 1. Interface and method call graphical notations
Error handling in the code samples is rudimentary. The code samples serve to demonstrate a design or a technical point, and cluttering them with too much error handing would miss the point. In a production environment, you should verify the returned ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access