You can use the Visual Basic extensibility object model to ease development through add-ins. Add-ins are tools that you create programmatically using objects and collections in the extensibility model to customize and extend the Visual Basic environment. In a sense, add-ins "snap on" to the Visual Basic integrated development environment (IDE).
Whether created in Visual Basic or Visual C++, the primary goal of an add-in is to enable you to automate something in the development environment that is difficult, or tedious and time-consuming to accomplish manually. Add-ins are time- and labor-saving automation tools for the Visual Basic programming environment.
Note When using C++ to develop add-ins, whenever you get a pointer from Visual Basic using Automation, you must call "release" when you are finished using it. Visual Basic follows the standard reference counting rules. For example, when you get a pointer out of Visual Basic by calling _NewEnum, you must call release through that pointer. Also, when you use pDispatch = m_ourMenuItems.Item(pszCaption)
, you must also use pDispatch->Release()
.
There are four types of add-ins: add-ins, Wizards, utilities, and builders.
For more information about wizards, see "Wizards and the Wizard Manager" in "How to Build an Add-In."
How to Build an Add-In" discusses the specifics of creating these add-in variants.
Most add-ins that you've seen or used before were probably visually-based; that is, they appeared as commands in menus or as buttons on toolbars in the Visual Basic IDE. Now, add-ins don't necessarily have to be visible — they can sit hidden in the background and respond to events such as the sizing of a form or control. Or they may be invisible and do something like reset a timer control when a certain project loads, or they may be entirely visual; for example they may size a group of like objects by sizing only one of the objects.