Chapter 1: Introduction to COM
Traditional Software Development
The Traditional Approach
Problems with the Traditional Approach
Problems of Traditional Software Development
Object-Oriented Techniques
Limitations of Using C++
Example of Converting a Class to a Component
Component Implementation
Software Development with COM
COM Defined
The Goals of COM
COM and ActiveX
Self-Check Questions
Chapter 2: Creating a Client of a COM Object
How COM Uses Strings
Steps for Creating a Client
Initializing the COM Libraries
Getting the CLSID of an Object
Creating an Instance of an Object
Using a COM Object
Uninitializing the COM Libraries
Self-Check Questions
Chapter 3: Creating a COM Object
COM Interfaces
Interface Fundamentals
Identifying Interfaces
Using GUIDs in C++
The IUnknown Interface
Overview of IUnknown
Reference Counting
Discovering the Functionality of a COM Object
COM Objects and COM Object Servers
Creating a COM Object
Deriving a C++ Class from an Interface
Implementing the Methods Of an Interface
Controlling the Lifetime of a COM Object
Creating a COM Object Server
Overview of Class Factories
Implementing a Class Factory
COM Object Servers as Executable Files
COM Object Servers as DLLs
Registering a COM Object Server
Registering CLSlDs
Using the .Reg File
Self-Check Questions
Chapter 4: Implementing Multiple Interfaces
Overview of Multiple Interfaces
Multiple Interfaces with Multiple Inheritance
Overview of Multip1e Inheritance
Using Multiple Inheritance
QueryInterface Changes for Multiple Inheritance.
QueryInterface Requirements
Multiple Interfaces with Embedding
Overview of Embedding.
Global Classes
Nested Classes
QueryInterface Changes for Embedding
Self-Check Questions
Chapter 5: Introduction to ATL
Overview of ATL
Overview Of Template Libraries
Features of ATL
Base Classes Provided by ATL
Creating an ATL Project
Using the ATL COM AppWizard
Results of the ATL COM AppWizard
Adding a Simple COM Object
The COM Object Header File
Results of Building an ATL Project
Adding an Interface
Modifying the COM Object Header File
Implementing the Methods
Registering an ATL COM Object
Creating a Client by Using C++ Extensions
Using the AfxOleInit Function
Importing a Type Library
Overview of Smart Pointers
Handling Smart Pointer Exceptions
Self-Check Questions
Chapter 6: Automation
Introduction to Automation
Benefits of Automation
Terminology
Features of Automation
Methods
Properties
Dispatch Interfaces
IDispatch
Using Variant Data Types
Dispinterface Memory Layout
Implementing IDispatch
Introduction to Type Libraries
Creating Type Libraries with IDL
Introduction to IDL
IDL File Structure
Dispinterface Definitions
Library and Coclass Definitions
Dispinterfaces and ATL
Structures in Automation
Self-Check Questions
Chapter 7: Dual Interfaces
Limitations of Automation
Benefits of Dual Interfaces
Limitations of Dual Interfaces
Creating a Dual Interface with ATL
Creating a COM Object with a Dual Interface
Adding Properties
Adding Methods
Automation from the Client Side
Using Standard Automation
Using a Dual Interface
Self Check Questions
Chapter 8: Adding Events
Overview of Events
Adding a Connection Point
Adding a Source Interface
Using the ATL Proxy Generator
Modifying the COM Object Header File
Firing an Event
Adding a Sink
Creating a Client Project
Adding an Event Interface
Creating a Sink Object
Removing a Sink Object
Modifying the Server for a Visual Basic Client
Adding a Dispinterface
Running the ATL Proxy Generator
Modifying the COM Object Header File for a Visual Basic Client
Firing an Event for a Visual Basic Client
Visual Basic Client Code
Self-Check Questions
Chapter 9: Creating an ActiveX Control
Introduction to ActiveX Controls
History of ActiveX Controls
Using MFC or ATL to Create an ActiveX Control
Features of ActiveX Controls
Building an ActiveX Control
Creating the Control
Stock Properties
Custom Properties
Reusing Window Classes
Creating a Property Page
Implementing a Property Page
Container Functionality
Ambient Properties
Container Requirements
Self-Check Questions
Chapter l0: Object Reuse in COM
COM and Inheritance
Benefits of Object Reuse
Role of Inheritance in Object Reuse
Binary Reuse Options in COM
COM Containment
COM Aggregation
Benefits and Issues of Aggregation
Chapter 11: Custom Interfaces
Introduction to Custom Interfaces
Benefits and Issues of Custom Interfaces
Creating a Proxy/Stub DLL
Remoting Efficiency
Marshaling
Locality and COM
Standard Marshaling
Custom Marshaling
Self-Check Questions
Chapter 12: Threading Models
Single-Threaded Applications
Apartment Models
Overview of Apartment Models
Single-Threaded Apartments.
Multi-Threaded Apartments
In-Process Servers
Registry Keys
Mixed Threading Models
Self-Check Questions
Chapter 13: Collections
Overview Of Collections
Collections and Object Models
Enumerators in ATL
Creating a Collection.
Creating a Root Object
Creating a Collection Object
Creating an Item Object
Implementing a Collection
Implementing a Root Object
Implementing a Collection Object
Implementing an Item Object
Using a Collection
Using a Collection with a Visual C++ Client
Using a Collection with a Visual Basic Client
Self-Check Questions