This document assumes a basic knowledge of what COM is and how it functions; however, you do not require an in-depth knowledge of COM to be able to use it effectively in VTS. Microsoft (and others) has published introductions to COM that can be found in numerous publications. The Platform SDK documentation chapter titled "Component Services\COM" is a good place to start if you require detailed background information on COM.
Note: The Platform SDK documentation is provided with Visual C++, or is available for download from Microsoft.
A COM object is a piece of code that exists in an in-process DLL or out-of-process executable file on a computer. The COM object encapsulates a set of behaviors that can only be accessed via a set of formally declared "interfaces". An interface contains a list of member methods (along with their typed parameters), that can be called. All interface methods return a result code of type HRESULT. These interfaces can be classified into two types:
• "VTable" interfaces
• "automation" interfaces
These two interfaces are described below.
VTable Interfaces
VTable or "Virtual Table" interfaces are very closely related to the virtual function table that would be generated for indirectly calling C++ virtual functions. Automation interfaces are defined by Microsoft in their OC96 specification and, essentially, provide a limited set of strongly typed functions that can be called from C++ or other compatible languages. As those functions exist in a VTable interface, knowledge about the function names, calling conventions, and parameter types must be known when the compatible language is compiled. This is termed "early binding".
Automation Interfaces
The early-bound functions of an automation interface, however, provide a mechanism to access a much broader range of methods that the object supports. The calling convention and binding of names to physical functions is performed at run-time, and does not have to be known at compile time. The automation interface mechanism also provides dynamic discovery of parameter type information. Such discovery and subsequent usage of the discovered functions is termed "late binding". These interfaces have largely grown out of the need for scripting languages to use COM objects without requiring compile-time knowledge of the object's methods.
VTS uses the late binding capability of automation interfaces to interact with a COM object.