Add-ins can be created using any number of technologies that are available with Visual C++. This manual will focus on creating Add-ins using the Active Template Library (ATL).
Creates a simple object that also supports the IBarlistAddin interface.Creating a Barlist Add-in Project
To create a Barlist Add-in Project, start the Microsoft Developer Studio and select New from the File menu.
In the New dialog, select the Projects tab and select the ATL COM AppWizard. Enter the name and location of your project and press the OK button.
Figure 5 New dialog
Next the ATL COM AppWizard begins. Set the server type to "Dynamic Link Library (DLL)". Select the other options at your discretion. Press the Finish button and then the OK button on the New Project Information dialog that appears next.
Figure 6 ATL COM AppWizard
This concludes the creation of the Barlist Add-in Project. Next we have to create a Barlist Add-in component.Creating the Barlist Add-in Component
To create a Barlist Add-in Component, select New ATL Object from the Insert menu. In the ATL Object Wizard, select the "WSDOT Barlist Add-in" object and press the Next button.
Figure 7 ATL Object Wizard
In the ATL Object Wizard Properties dialog, enter the name of your Barlist Add-in component in the Short Name field. You can change the other fields and the Attribute settings at your discretion. Press the OK button.
Figure 8 ATL Object Wizard Properties Dialog
This concludes the creation of the Barlist Add-in Component. Next we have to modify a few compiler settings before we can compile the component.Modify Compiler Settings
Before we can compile your Add-in component, we need to specify additional includes paths for both the header files and the IDL files. Select Settings from the Project menu. Select the project node in the tree view. Select "All Configurations" in the "Settings For" field. In the "Additional include directories" field enter <TBD>. Dont press the OK button yet.
Figure 9 Project Settings for header file included paths
Select the MIDL tab and enter <TBD> in the "Additional include directories" field. Press the OK button. Now you are ready to compile your Barlist Add-in Component.Implementing the Add-in
Implementing your Barlist Add-in is fairly simple. The MenuItem property supplies the text that will appear on the Add-in menu of the Barlist program. Just replace the text supplied by the code generator with an appropriate string. The Go method can do what ever you like.
Copyright © 1999, Washington State Department of Transportation