Automation Through ActiveX Objects

Just as a user interface helps a user communicate with a software application, automation enables applications or scripting tools to interact with other applications or tools. Automation is a COM-based technology that enables interoperability among Microsoft® ActiveX™ components, including OLE components. To make their services available, applications or tools define COM objects to expose their unique features in terms of methods, properties, and events. Other applications and tools interact with the exposed objects to use these services. The exposed COM objects are known as ActiveX objects and the applications or tools calling ActiveX objects are known as ActiveX clients.

ActiveX clients invoke the IDispatch interface, or they call member functions directly in the object's virtual function table (VTBL). The table lists the addresses of all the properties and methods of an object, including the member functions of the interface it supports. The first three members of VTBL are the members of the IUnknown interface. ActiveX objects implementing a VTBL interface are standard COM objects. Clients must support pointers to access these objects. However, the object implementing the IDispatch interface offers additional features that makes the object accessible to a client without any pointer support. Clients written in Visual Basic use IDispatch, whereas those written in C++ may use both VBTL and IDispatch. The ActiveX objects in your applications should support both interfaces.

ActiveX objects publish themselves by means of Type Libraries, which are used by clients to determine the characteristics of an object, such as the supported interfaces and the names and addresses of the members of each interface. The developer of an ActiveX object should create the type library. Windows CE offers full support of the four type-building interfaces: ICreateTypeInfo, ICreateTypeInfo2, ICreateTypeLib and ICreateTypeLib2.

For a complete discussion of COM-based object services, see the documentation for the Microsoft Platform SDK.