Adding Objects and Controls to an ATL Project


For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

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:

ATL Simple ObjectATL DialogATL Control
ATL Property PageATL Active Server Page ComponentATL OLE DB Consumer
Add ATL Support to MFCATL COM+ 1.0 Component WizardATL OLE DB Provider
System_CAPS_ICON_note.jpg Note

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

  1. In Solution Explorer, right-click the project node and click Add from the shortcut menu. Click Add Class.

    The Add Class dialog box appears.

  2. 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.

    System_CAPS_ICON_note.jpg Note

    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.

ATL Project Wizard
Visual C++ Project Types
Creating Desktop Projects By Using Application Wizards
Fundamentals of ATL COM Objects
Programming with ATL and C Run-Time Code
Default ATL Project Configurations