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

Comparing In-Process and Out-of-Process Server Components

VB6 enables you to create two types of COM components:

  • Out-of-process server components. Out-of-process server components are always EXE files.

  • In-process server components. In-process server components are always DLL files.

The difference between these server component types is with respect to the client application.

When a server component runs out-of-process with respect to its client, it has the following characteristics:

  • It can run as a standalone application completely apart from the client.

  • It does not share the same address space under the operating system.

  • Its public creatable classes can be instantiated either as SingleUse or MultiUse objects. (See "The Instancing Property of COM Component Classes" later in this chapter for a discussion of these concepts.)

When a server component runs in-process with its client, it has these important features:

  • The server component and client share the same executable space under the operating system.

  • The server component and client share some of the same memory.

  • An in-process server component's public creatable classes can be instantiated only as MultiUse objects. (See "The Instancing Property of COM Component Classes" later in this chapter.)

As you might imagine, there are pros and cons to both in-process and out-of-process server components.

Performance: In-Process Server Components Win the Contest

Because an in-process server component shares the same process space with its client at runtime, communication between the in-process server component and its client can avoid the ActiveX interface. The client can therefore call the in-process server component very efficiently.

Flexibility and Availability: Out-of-Process Server Components Win the Contest

Here is a list of things only an out-of-process server component can do:

  • Provide classes that are either SingleUse or MultiUse. (See "The Instancing Property of COM Component Classes" later in this chapter.)

  • Display modeless forms.

  • Use the End statement (although not recommended in every application because it prevents the firing of an Unload or Terminate event).


  

<< Previous | Contents | Next >>

Home | About Us | Privacy Policy | Contact Us

Copyright © Freetutes.com | All Rights Reserved