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:

ATL Simple Object

ATL Dialog

ATL Control

ATL Property Page

ATL Active Server Page Component

ATL OLE DB Consumer

Add ATL Support to MFC

ATL COM+ 1.0 Component Wizard

ATL OLE DB Provider

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.

    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.

See Also

Tasks

Creating Projects By Using Application Wizards

Reference

ATL Project Wizard

Fundamentals of ATL COM Objects

Default ATL Project Configurations

Concepts

Visual C++ Project Types

Programming with ATL and C Run-Time Code