Chapter 1
A component for C/C++ clients
Introduction
A COM object and its VTable
A GUID
QueryInterface(), AddRef(), and Release()
An IClassFactory object
Packaging into a DLL
Our C++/C include file
The Definition (DEF) file
Install the DLL, and register the object
An example C program
An example C++ program
Modifying the code

Chapter 2
A component for scripting clients

Why script languages can't use our DLL as is
Automation datatypes (ie, BSTR, VARIANT)
The IDispatch functions
The type library
Registering the type library
A VBscript example
A Property
An updated example C application
Packaging the component into an EXE Chapter 3 Collections

A list Defining a collection object
Some helper functions
Our collection object's functions
How an application obtains our collection object
A VBscript example
A C example
An IEnumVARIANT object
Another VBscript example
Another C example
A more generic approach
Add/Remove items Chapter 4 Multiple interfaces, and delegation

Multiple interfaces
Embedding sub-objects in our object
How an app obtains the base object
How an app obtains a sub object from the base object
How an app obtains an object from another sub-object
Delegation
QueryInterface, AddRef, and Release of our base object
QueryInterface, AddRef, and Release of our sub-objects
Another way to add a sub-object to our object
An example object with multiple interfaces
An example C app that uses our object
Scripting limitations Chapter 5 Event source/sink (Connectable objects)

Callback functions
Wrapping a callback function in a COM object
IConnectionPointContainer and IConnectionPoint objects
An example C app
Adding support for script languages
Another example C app
A VBscript example
Multiple types of callback objects
Multiple callback objects Chapter 6 An ActiveX Script Host

Introduction
Choosing/opening an engine
Our IActiveScriptSite object
An example VBscript
Initializing the engine
Adding a script to the engine
Running scripts
Closing an engine
Loading a script
Enumerating installed engines
Running a script in another thread Chapter 7 A Script Host's custom objects

Declaring our custom COM object
Our IDL file and type library
Register our COM object with the engine
How a script calls our COM object functions
Our IProvideMultipleClassInfo object
Application and document objects
A C++ example host Chapter 8 Miscellaneous Script Host details

Persistent script code
Script code and "Named Items"
Call a particular function in a script
Query/set a variable in a script
Interfacing different languages