Introduction to COM
This document assumes a basic knowledge of what the Component Object Model (COM) is and how it functions. Introductory information available from Microsoft and others may be helpful if you require more background information on COM.
The Platform SDK documentation is provided with Visual C++, and is available for download from Microsoft. This provides a good starting point for those new to the Component Object Model.
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:
Virtual Table interfaces and Automation interfaces
These two interfaces are described as follows:
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".
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.
VTScada uses the late binding ability of automation interfaces to interact with a COM object.