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

Chapter 12 - Creating a COM Component that Implements Business Rules or Logic

( Contents )

A COM component provides reusable, encapsulated functionality to client programs running in a Windows environment. You can use VB to create one of the several types of COM components.

A COM component's threading model affects the way that the COM component handles requests from clients and manages memory.

An object is externally creatable when an application that can serve as an ActiveX client can declare an instance of (that is, instantiate) that object as a variable and then manipulate the methods and properties of that object.

You can register your server component in the Windows Registry in one of several ways. These ways are discussed in more detail in the section titled "Registering and Unregistering a COM Component." A Visual Basic project provides an externally creatable object through certain project settings and by possessing a class module whose properties you have set appropriately.

An externally creatable object also typically provides a gateway to other objects that can't be directly created by clients. Every COM component provides at least one externally creatable object. The server component's externally creatable objects, together with the other objects indirectly exposed by the externally creatable objects, is known as an object hierarchy or object model.

You can implement your own COM component's object model with custom object classes. Although you can create custom object classes specific to a single application, Microsoft's published documentation and courseware are full of examples of classes used to implement COM components.

Contents

  1. Overview of COM Component Programming

  2. The COM Specification and the ActiveX Standard
          Comparing In-Process and Out-of-Process Server Components
          Steps in Creating a COM Component

  3. Implementing Business Rules With COM Components

  4. Implementing an Object Model With a COM Component

  5. Implementing COM Components Through Class Modules
          The Uses of Class Modules
          Starting a Class Module in a Standard EXE Project
          The Class Module Name Property
          Implementing Custom Methods in Class Modules
          Implementing Custom Properties in Class Modules
          Implementing Custom Events in Class Modules
          Built-In Events of Class Modules
          Using Public, Private, and Friend Keywords
          Storing Multiple Instances of an Object in a Collection
          Implementing Built-In Collection Features in the Dependent Collection Class
          Declaring and Using a Class Module Object in Your Application
          Manipulating Class Object Properties and Methods

  6. Managing Threads in a COM Component
          Managing Threads in ActiveX Controls and In-Process Components
          Managing Threading in Out-of-Process Components

  7. The Instancing Property of COM Component Classes
          Using Private Instancing for Service Classes
          Using PublicNotCreatable Instancing for Dependent Classes
          Instancing Property Settings for Externally Creatable Classes
          Using SingleUse Instancing for Separate Instances of Every Object
          Using GlobalSingleUse to Avoid Explicit Object Creation
          Using MultiUse Instancing for Object Sharing and Using GlobalMultiUse Instancing to Avoid Explicit Object Creation
          Deciding Between SingleUse and MultiUse Server Classes

  8. Handling Errors in the Server and the Client
          Passing a Result Code to the Client
          Raising an Error to Pass Back to the Client

  9. Managing Components With Visual Component Manager
          Storing VCM Information in Repository Databases
          Making VCM Available in the VB IDE
          Publishing Components With VCM
          Finding and Reusing Components With VCM

  10. Using Interfaces to Implement Polymorphism
          Steps to Implement an Interface Class
                Creating the Interface Class
                Implementing the Interface Class in Other Classes
                Methods for Using the Interface Class in a Client
                      Method A: Using an Object Variable in the Client
                      Method B: Using Wrapper Routines in the Client

  11. Providing Asynchronous Callbacks
          Providing an Interface for the Callback Object
          Implementing the Callback Object in the Client
          Manipulating the Callback Object in the Server

  12. Registering and Unregistering a COM Component
          Registering/Unregistering an Out-of-Process Component
          Registering/Unregistering an In-Process Component

  13. Sending Messages to the User from a COM Component
          Managing Forms in an Out-Of-Process Server Component
          Managing Forms in an In-Process Server Component

  14. Choosing the Right COM Component Type

  15. Implementing Scalability Through Instancing and Threading Models

  16. Under-the-Hood Information About COM Components


  

Get Started >>

Home | About Us | Privacy Policy | Contact Us

Copyright © Freetutes.com | All Rights Reserved