Add Class Dialog Box


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

The latest version of this topic can be found at Add Class Dialog Box.

The Add Class dialog box contains templates that allow you to:

- or -

  • Automatically create your new class by adding the appropriate files and source code to your project.

You can access the Add Class dialog box from the Project menu, Solution Explorer, or Class View.

System_CAPS_ICON_note.jpg Note

When you attempt to add a class that is not suited to your current project, you will receive an error message. Click OK to return to the Add Class dialog box.

There are four categories of Add Class templates: .NET, ATL, MFC, and Generic. When you select a template in the Templates pane, text describing your selection will appear under the Categories and Templates panes.


ASP.NET Web ServiceNot available
Component Class (.NET)Not available
Installer Class (.NET)Not available
User Control (.NET)Not available
Windows Form (.NET)Not available


Add ATL Support to MFCNot available
ATL Active Server Page ComponentATL Active Server Page Component Wizard
ATL ControlATL Control Wizard
ATL DialogATL Dialog Wizard
ATL COM+ 1.0 ComponentATL COM+ 1.0 Component Wizard
ATL OLEDB ConsumerATL OLE DB Consumer Wizard
ATL OLEDB ProviderATL OLE DB Provider Wizard
ATL Property PageATL Property Page Wizard
ATL Simple ObjectATL Simple Object Wizard
WMI Event ProviderWMI Event Provider Wizard
WMI Instance ProviderWMI Instance Provider Wizard


MFC ClassMFC Add Class Wizard
MFC Class From ActiveX ControlAdd Class From ActiveX Control Wizard
MFC Class From TypeLibAdd Class From Typelib Wizard
MFC ODBC ConsumerMFC ODBC Consumer Wizard

Generic Classes

Generic C++ ClassGeneric C++ Class Wizard

Adding a Member Function
Adding a Member Variable
Overriding a Virtual Function
MFC Message Handler
Navigating the Class Structure