Using the COM Addin Template

To make the COM add-in template available as one of the selections when creating a new VB project, copy the COM Add-in template files to the Projects folder under the VB Templates folder (usually C:\Program Files\Microsoft Visual Studio\VB98\Template\Projects), as shown in Figure 13.1.

When you next open VB, you will see a COM Add-In selection as one of the available project template choices, as shown in Figure 13.2.

Once you've selected the COM Add-In template and have clicked OK, a new project is created based on the template, including a form, a module, and a designer. These objects are located in the Project Explorer (on the right side of the VB window), as shown in Figure 13.3.

FIGURE 13.1

Copying the COM Add-In project files into the VB Projects folder.

FIGURE 13.1

Copying the COM Add-In project files into the VB Projects folder.

The COM Add-In project template selection in VB 6.

FIGURE 13.3

A new VB project created from the COM Add-in project template.

FIGURE 13.3

To set a reference in a VB 6 project, drop-down the Project menu and select References, as shown in Figure 13.4.

FIGURE 13.4

Opening the VB 6 References dialog.

FIGURE 13.4

For best functioning, a COM add-in designed to run in Access should have a reference set to the Access and (if needed) DAO object libraries, as shown in Figure 13.5. If you create your own COM add-in from scratch, you will probably need to set one or both of these references; I have set them in the sample VB template project, so they are already checked in projects made from this template.

0 0

Post a comment