Microsoft Office 2000/Visual Basic Programmer's Guide |
An add-in designer is a file included with the template project that helps you create and register your COM add-in. You can create a COM add-in without including an add-in designer, but it simplifies the process of creating and registering the add-in. You can use an add-in designer to specify important information for your COM add-in: its name and description, what application it is to run in, and how it loads in that application.
Like forms in a Visual Basic project, an add-in designer (shown in Figure 11.1) has a user interface component and an associated class module. The user interface component is never visible to the user when the add-in is running, however; it's visible only to the developer at design time. You can think of the add-in designer as a sort of dialog box where you specify settings for an add-in.
Figure 11.1 An Add-in Designer for Visual Basic 6.0
The class module contains the events that occur when the add-in is loaded or unloaded. You can use these events to integrate the add-in into the application.
When you create the add-in DLL, Visual Basic 6.0 uses the information you've given to the add-in designer to properly register the DLL as a COM add-in. Visual Basic 6.0 writes the add-in's name, description, and initial load behavior setting to the registry. The add-in's host application reads these registry entries and loads the add-in accordingly.