beginners tutorial - Learn VB6
VB6 tutorial - Learn Advanced VB6
Analysis - System analysis and Design tutorial for Software Engineering
You are here: Visual
Basic > Advanced VB6 tutorial
> Chapter 12
Publishing Components With Visual Component Manager (VCM)
To make a component available for reuse through VCM, you must first publish
that component in a VCM repository database.
To publish a component through VCM from within the current project, you should
take some preliminary steps to prepare the component for publication and to invoke
VCM, as discussed in Step by Step 12.1.
STEP BY STEP
12.1 Preparing to Publish a Component with Visual Component Manager
If you intend to publish the component's source code, make sure that you have
saved the project before publishing it. Otherwise, VCM will give you the warning
Project must be saved before it can be published when you attempt to publish the
Click the VCM icon on the VB toolbar to invoke the VCM window (see Figure 12.10).
FIGURE 12.10 The main window for VCM
Choose a folder within the VCM repository by doubleclicking one on the tree
in the left-hand window.
Invoke the VCM Publish wizard through one of three methods:
• Drag a compiled component (*.DLL, *.OCX, or *.EXE) from Windows Explorer
to a folder in the Visual Component Manager window.
• Make sure that you have opened a folder in the repository (double-click
it in the VCM window). Then, rightclick in the folder's contents (the upper center
and right pane of the VCM window). Click New on the resulting Visual Component
Manager shortcut menu.
• Select the component's project window in Project Explorer and right-click
the project name to invoke the project's shortcut menu (see Figure 12.11). Choose
Publish on the project's shortcut menu. When you click Source Files, you will
publish the project's source-code files; when you click Build Outputs, you will
compile and publish its outputs. This third technique does not require you to
have the VCM window open.
FIGURE 12.11 Visual Component Manager's Publish menu. In this figure, the
developer has accessed the menu by right-clicking the Project's name in the Project
Publish Wizard will display an introductory screen (not shown here). Click
the Next button to proceed.
On the next screen (Repository/Folder), you can choose a VCM repository database
(see Figure 12.12) and then a folder within that database (see Figure 12.13).
FIGURE 12.12 Initial view of VCM's Repository/Folder dialog box
FIGURE 12.13 VCM's Repository/Folder dialog box, showing available folders
Complete the Repository/Folder dialog box by editing, if necessary, the name
that you want to give to the component. (This name is for informational purposes
only and will not affect project or Registry names.) The completed dialog box
should look like Figure 12.14. Click the Next button to continue to the Title
and Properties dialog box.
FIGURE 12.14 VCM's Repository/Folder dialog box, showing a selected folder
and the name of a component to add to VCM's repository database.
You typically don't change anything on the Title and Properties dialog box,
although of course you can (see Figure 12.15). Click Next to proceed to the More
FIGURE 12.15. VCM's Title and Properties dialog box.
From the More Properties screen (Figure 12.16), you can add a component description
and keywords. Other developers can use the description and keywords to find your
FIGURE 12.16 A second Properties screen in VCM enables you to add a component
description and keywords.
You can add a new keyword to the component by clicking the large plus button
(+) on the More Properties screen and filling in the keyword text on the resulting
dialog box (see Figure 12.17).
FIGURE 12.17. Adding a new keyword to a component in VCM.
Click the Next button to proceed to the next Publish Wizard screen. A list
of files that will be published as part of the component appears, as shown in
Figure 12.18. Depending on whether you chose to publish source code or the compiled
component (see step 3), you will either see the source-code files for the project
or the compiled file (and any known files that the compile file depends on to
run). At this point, you can add or take away files. After you have finished,
click the Next button to proceed to the next screen.
FIGURE 12.18 You can add or delete files from a published component's source
code with the VCM Select Additional File(s) dialog box.
On the next screen, you can indicate whether any of the files that you are
publishing with the COM component require an entry in the Windows Registry (see
Figure 12.19). Usually you need to do nothing on this screen, because VCM is pretty
good at guessing which files need registration. In fact, if you try to check a
file that obviously doesn't need registration (such as a source-code file), VCM
will warn you that the file doesn't need registration and will refuse to check
the box next to the file's name.
FIGURE 12.19 You can indicate the files that belong to a published component
and that must be registered in the Windows Registry.
- After you have made any adjustments to your component's registration information,
you can click the Next button. This brings up the Publish wizard's final screen
(the Finish screen). Click the Finish button on this screen to finalize your component's
entry in the VCM repository database.
<< Previous | Contents
| Next >>