COM Automation lets you use functionality from a COM component (which may be
a standalone application, an ActiveX DLL library, or a module inside an application)
Most Microsoft products and commercial vendors' applications provide a COM
interface to the services that applications provide. Applications that provide
services via a COM interface are called COM components. The client applications
that use COM components are called COM clients. There are two basic types of COM
clients. One type of client is the ActiveX Document container. This type of client
application is used to host ActiveX Documents. The other type of COM client, and
the type that we will discuss in this chapter, communicates with COM components
through automation. Chapter 12,
"Creating a COM Component that Implements Business Rules or Logic," provides
more detail on creating COM components.
Automation enables you to script commands to applications. Therefore, your
client applications can use a COM component that has exposed its objects to the
outside world. This chapter discusses how to use COM components in a VB6 application.
This chapter covers the following topics:
Understanding the meaning of COM and the ActiveX standard.
Using GetObject and CreateObject to instantiate COM component object variables
that contain references to COM components.
Understanding and using early and late binding for object variables that are
instances of COM components.
Using automation to handle a COM component's methods and properties.
Using automation to handle a COM component's events in a VB program.
Debugging VB code that uses objects from a COM component.
Releasing an instance of a COM component from memory.
Using the Object Browser to get and interpret information about the objects
made available by a COM component.