Home

Tools to Manage Projects: The MFC Class Wizard

   

Introduction

The MFC Class Wizard is a dialog box that can be used to create and manage classes of a project. The classes must use, or inherit from, MFC existing classes. There are various ways you can access the MFC Class Wizard:

  • At any time on the menu, you can click Project -> Class Wizard...
  • In the Solution Explorer,  right-click the name of the project or the name of a folder, and click Class Wizard...
  • In the Class View, right-click the name of the project or the name of a class, and click Class Wizard...
  • In the Resourve View, right-click the name of the project and click Class Wizard
  • If a dialog box (or a form) being designed is displaying in the middle area, right-click it (or any object on it) and click Class Wizard

A Description of the MFC Class Wizard

As mentioned already, the MFC Class Wizard is reserved for MFC and MFC-based classes. If there is no such a class in the project or the wizard cannot identify one, it would first appear empty:

MFC Class Wizard

The MFC Class Wizard is made of various sections. The Project combo box displays the name of the current project. If the solution contains many projects, their names would appear in the combo box. Here is an example:

MFC Class Wizard

The Class Name combo box displays a list of the MFC-based classes that are part of the project selected in the Project combo box. If there is no MFC class in the selected project, the Class Name combo box would be empty.

If the Class Name has a resource file, its identifier would be displayed in the Resource text box:

MFC Class Wizard

From the MFC Class Wizard, you can create an MFC-based class. To do that, click the Add Class button. This would open the MFC Add Class Wizard that we will see in various parts of our lessons.

After selecting a class in the Class Name combo box, the Base Class text box displays the class from which the Class Name value is derived.

The Class Declaration text box displays the name of the header file where the Class Name is declared.

The Class Implementation text box displays the name of the source file where the Class Name is defined.

The Commands tab displays a list of the objects (such as Windows controls) that are positioned on, or are accessible to, the Class Name object:

MFC Class Wizard

We will come back to this tab when we study the Windows controls.

The Messages tab holds a list of the Windows messages available to the Class Name and inherited from the Base Class:

MFC Class Wizard

The Virtual Functions tab displays a list of member functions available to the Class Name. The Member Variables section shows a list of the objects positioned on the dialog box. We will come back to it. The Methods property page has the methods that have already been created in the Class Name.

Each tab is equipped with some buttons on the right side. The usefulness and behavior of these buttons depend on what is selected on the left list(s) of the same tab.

 
 
     
 

Home Copyright © 2010-2016, FunctionX