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 12
Steps in Creating a COM Component
To implement a server component application, you must define classes that will
become the server component's exposed objects.
n this section, you learn the basic steps for creating a server component
and implementing classes in the server component. Later in this chapter, you also
see how to test, fine-tune, maintain, and distribute your server component.
To create a server component application, follow these basic steps:
-
Start a new project for the server component class. Use the ActiveX DLL template for
in-process component or EXE template for out-of-process component.
-
Change the project's name to match the name you want to give your server component
application. This choice of name is important, because it is the name that the Windows
Registry will use to identify the server component and the name that clients will
use when they instantiate objects from the server component with the servername.classname
syntax.
For each object class that you want to implement in the server component, follow
these steps:
-
Add a class module to the server component project.
-
Set the class module's Name property to match the name you want to give the
class.
-
If the class is to be externally creatable, make sure that the class module's
Instancing property is set to SingleUse, MultiUse, GlobalSingleUse, or GlobalMultiUse.
(The ActiveX DLL or ActiveX EXE automatically sets this property, but you should
check it anyway.) If the class should not be directly created by clients, choose
one of the other Instancing property's options (see the following section titled
"The Instancing Property of COM Component Classes").
-
Implement the class object's members (methods, properties, and events) according
to the guidelines given in the sections under "Implementing
COM Components Through Class Modules" later in this chapter.
-
Create the other classes you need to round out your object's functionality.
<< Previous | Contents
| Next >>
|
|