Adding Commands to the Add-in (Windows CE 5.0)
If you work with a previously created add-in, you may want to add new commands.
To add a command to the add-in
- Open the add-in project.
- In ClassView, expand the project classes.
- Select the ICommands interface, and then right-click.
- Choose the Add Method command.
- In the Method Declaration field, enter the method that specifies what the command is supposed to do.
- In ClassView, expand the CCommands class, and then double-click the method name.
- In the Commands.cpp file, write the code for the method.
- In ClassView, expand the CPBAddIn class.
- Double-click the IDSAddIn::OnConnection method.
- Search for code that adds a command. This code calls the IApplication::AddCommand method.
- For the new command, copy and customize the AddCommand call.
Optionally, you can provide a toolbar button the user can press to carry out the command. If you used the Platform Builder Add-in Wizard and selected the Provides a Toolbar option, then the wizard generated the code needed to provide a button. However, if you did not select that option, you must add the necessary code.
As another option, you can create a image graphic for the toolbar button. If you used the Platform Builder Add-in Wizard and selected the Provides a toolbar option, then the wizard automatically created an image graphic for the button.
Finally, you can optionally assign a key sequence to the command.
See Also
New Commands and Toolbar Buttons | Creating Toolbar Buttons for Add-in Commands Programmatically | Creating Toolbar Buttons for Add-in Commands Visually
Send Feedback on this topic to the authors