VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

Systems Analysis - System analysis and Design tutorial for Software Engineering

You are here: Visual Basic > Advanced VB6 tutorial > Chapter 10

Chapter 10 - Instantiating and Invoking a COM Component

( Contents )

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) using objects.

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.


  1. COM, Automation, and ActiveX

  2. Creating a Visual Basic Client Application that Uses a COM Component

  3. Setting a Reference to a COM Component

  4. Using the Object Browser to Find Out About a COM Component's Object Model

  5. Using the New Keyword to Declare and Instantiate a Class Object from a COM Component

  6. Late and Early Binding of Object Variables

  7. Using the CreateObject and GetObject Functions to Instantiate Objects

  8. Using a Component Server's Object Model

  9. Manipulating the Component's Methods and Properties

  10. Releasing an Instance of an Object

  11. Detecting Whether a Variable Is Instantiated

  12. Handling Events from a COM Component


Get Started >>

Home | About Us | Privacy Policy | Contact Us

Copyright © | All Rights Reserved