Adding Objects and Controls to an ATL Project
You can use one of the ATL code wizards to add an object or a control to your ATL- or MFC-based projects. For each COM object or control you add, the wizard generates .cpp and .h files, as well as an .rgs file for script-based registry support. The following ATL code wizards are available in Visual Studio:
Before adding an ATL object to your project, you should review the details and requirements for the object in its related Help topics.
To add an object or a control using the ATL Control Wizard
In Solution Explorer, right-click the project node and click Add from the shortcut menu. Click Add Class.
The Add Class dialog box appears.
With the ATL folder selected in the Categories pane, select an object to insert from the Templates pane. Click Open. The code wizard for the selected object appears.
If you want to add an ATL object to an MFC project, you must add ATL support to the existing project. You can do this by following the instructions in Adding ATL Support to Your MFC Project.
Alternately, if you attempt to add an ATL object to your MFC project without previously adding ATL support, Visual Studio prompts you to specify whether you want ATL support added to your project. Click Yes to add ATL support to the project and open the selected ATL wizard.