Creating Toolbar Buttons for Add-in Commands Programmatically
If you work with a previously created add-in, you may want to add new toolbar button for your commands.
The following steps show how to add the code for a button.
Open the project for the add-in.
In ClassView, expand the project's classes, and then expand the CPBAddIn class.
Double-click the IDSAddIn::OnConnection method.
Search for the code that adds the appropriate command. This code calls the IApplication::AddCommand method.
After the AddCommand call, call the IApplication::AddCommandBarButton method if the bFirstTime parameter of the OnConnection method has a value of VARIANT_TRUE.
This parameter directs Visual Studio to call AddCommandBarButton only when the user first connects the add-in to Visual Studio.
See Also
Creating Toolbar Buttons for Add-in Commands Visually
Last updated on Friday, October 08, 2004
© 1992-2003 Microsoft Corporation. All rights reserved.