Once you have created a project, you will want to change or add to that project's functionality. Such tasks include creating new classes, adding new member functions and variables, and adding Automation methods and properties. The code wizards are designed to let you do all these things.
Note
The following rarely-used code wizards are removed in Visual Studio 2019. General support for ATL and MFC is not impacted by the removal of these wizards. Sample code for these technologies is archived at Microsoft Docs and the VCSamples GitHub repository.
- ATL COM+ 1.0 Component Wizard
- ATL Active Server Pages Component Wizard
- ATL OLE DB Provider Wizard
- ATL Property Page Wizard
- ATL OLE DB Consumer Wizard
- MFC ODBC Consumer
- MFC class from ActiveX control
- MFC class from Type Lib.
Note
You can add message handlers and map messages to them and override MFC virtual functions using the MFC Class Wizard.
There are three locations where you can access C++ code wizards:
-
On the Project menu, the Add New Item command allows you to bring up the
Add New Itemdialog box, which helps you to add new files to your project. The Add Class command displays the Add Class dialog box, which in turn open wizards for each of the class types you can add to your project. For MFC classes, use the MFC Class Wizard. The Add Resource command displays the Add Resource dialog box, from which you can create or select a resource to add to your project.If you highlight a class or an interface in your project in Class View, the Project menu also displays the following commands:
-
Implement Interface (from a control class only)
-
Add Function
-
Add Variable
-
Add Connection Point (ATL class only)
-
Add Method (from an interface only)
-
Add Property (from an interface only)
-
Add Event (from a control class only)
-
-
In Solution Explorer, right-clicking any folder and clicking Add from the shortcut menu allows you to add new or existing files, more folders, items, classes, resources, and Web references to the project.
-
From the Class View window, right-clicking the appropriate node and clicking Add from the shortcut menu allows you to add functions, variables, classes, properties, methods, events, interfaces, connection points, or other code to your project.
[!NOTE] Visual Studio does not provide a wizard to add an interface to a project. You can add an interface to an ATL project or to an Adding ATL Support to Your MFC Project by adding a simple object using the ATL Simple Object Wizard. Alternately, open the project's .idl file and create the interface by typing:
interface IMyInterface { };See Implementing an Interface and Adding Objects and Controls to an ATL Project for more information.
Overriding a Virtual Function
Navigate your C++ code base in Visual Studio
C++ project types in Visual Studio
File Types Created for Visual Studio C++ projects
