Freetutes.com

VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

VB .NET - Learn Visual Basic .NET

Systems Analysis - System analysis and Design tutorial for Software Engineering


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

The Instancing Property of COM Component Classes

Class modules in a COM component can be classified according to their relationship to client applications:
  • Service classes - These classes are for internal use by the server itself and are invisible and unusable to clients.

  • Dependent classes - These classes are visible to clients, but clients can only instantiate and manipulate them indirectly through the third type of class, externally creatable classes. (For a further discussion of dependent classes, see the subsections under "Storing Multiple Instances of an Object in a Collection" in this chapter).

  • Externally creatable classes - These classes are visible to clients, and clients can instantiate and manipulate their objects directly.

When you create a class module in a COM component, you should set its Instancing property to reflect how the class module will behave with respect to clients.

To set the class's Instancing property, follow these steps:

  • In Project Explorer, right-click the name of the class module to bring up the pop-up menu for this class module.

  • Choose the Properties option from the pop-up menu. On the Properties window, you can choose the drop-down list for the Instancing property's settings (see Figure 12.7).

    Choices for the Instancing property in the Properties dialog box of a class module in an ActiveX EXE project.
    FIGURE 12.7 Choices for the Instancing property in the Properties dialog box of a class module in an ActiveX EXE project.

Note that the Instancing property is unavailable for the class modules of nonserver projects. In such projects, the Instancing property is always implicitly Private.

 


  

<< Previous | Contents | Next >>

Home | About Us | Privacy Policy | Contact Us

Copyright © Freetutes.com | All Rights Reserved