Home Page (Add-ins) | Overview | How Do I ... Topics | FAQ | Reference
The Developer Studio Add-in Wizard creates only the source files for an add-in. When you complete the add-in by building its project, Developer Studio creates a DLL from these source files.
Additionally, the Developer Studio Add-in Wizard creates classes for each add-in. These classes appear in the ClassView pane of the Project Workspace window and are graphical representations of what the source files contain. If you edit the classes, Developer Studio automatically changes the corresponding files.
The Developer Studio Add-in Wizard creates multiple files for each add-in. The following table describes these files. Note that Add-in_name represents the name of the add-in created.
File name | Description |
Add-in_name.h | Includes the principal header information for the add-in. |
Add-in_name.cpp | Contains the main source code for the add-in DLL. This file includes the OLE entry points required by in-process servers. |
Add-in_name.odl | Includes the Object Description Language source code for the type library created by the add-in. |
Add-in_name.rc | Lists all Windows resources that the add-in uses. For example, this file includes the sample toolbar bitmap stored in the RES subdirectory. You can edit this file Visual C++. |
Add-in_name.rc2 | Contains all resources that you cannot edit Visual C++. |
Add-in_name.def | Includes definitions required for the add-in to run with Windows. This file contains parameters such as the name and description of the add-in. This file also exports functions from the add-in. |
Add-in_name.clw | Contains information used by ClassWizard to edit existing classes or add new classes. ClassWizard also uses this file to store information needed to create and edit message maps and dialog box data maps and to create prototype member functions. |
Commands.cpp and Commands.h |
Contain the Ccommands class that implements the command dispatch interface defined by the Commands object. This interface contains one method for each command the add-in adds to the environment. |
Dsaddin.cpp and Dsaddin.h |
Includes the CDSAddIn class that implements the IDSAddIn interface defined by the DSAddIn object. This interface contains handlers for connecting the add-in to the development environment and disconnecting it from the environment. |
Resource.h | Defines new resource IDs. This is the standard header file, and Visual C++ reads and updates this file. |
Stdafx.h and Stdafx.cpp |
Build the precompiled header file Add-in_name.pch. |
The Developer Studio Add-in Wizard creates multiple classes for each add-in. When you open the add-in, these classes appear in the ClassView pane, and they represent the source files produced for the add-in. You can change the add-in by modifying these files or by adding members to these classes.
The following table describes these classes. Note that Add-in_name represents the name of the add-in created.
Class name | Description |
CCommands | Implements the Icommands interface. In the CCommands class, you add the methods that Developer Studio uses to carry out commands added by the add-in. |
CDSAddIn | Implements the IDSAddIn interface declared in header files provided with Visual C++. This interface exposes the DSAddIn object that the add-in uses to communicate with the development environment. |
Cadd-in_nameApp | Registers and initializes the add-in. |
ICommands | Specifies the interface defined by the Commands object. Through this interface, Visual C++ carries out commands added by the add-in. |
For examples of how to use these files and classes, see the add-in samples.