Ø The New Class Dialog Box:ClassView,
WizardBar and ClassWizard all use the New Class dialog box to assist you in
adding classes to your projects.
To open the New Class dialog box
Right-click on the project icon in ClassView, and click New
Class on the shortcut menu.
-or-
On the WizardBar Action menu, click New Class.
-or-
On the Visual C++ Insert menu, click New Class.
-or-
On the View
menu, click ClassWizard. Click ClassWizard's Add Class button, and on the menu
click New.
The New Class dialog box has four variants: one for MFC
classes, one for ATL classes, one for Generic classes, and one for Form-based
classes. The development environment detects the active project type, and
modifies the New Class dialog box accordingly. The following table describes
the class types that are available from the New Class dialog box for MFC and
ATL projects.
Ø Adding a Generic
Class:
A generic
class is a class that you define or that is derived from a class that you define.
To add a generic class, you can use ClassView, WizardBar, or the New
Class command (Insert menu).
To add a
generic class to your project
- Open the New Class dialog
as described in the New Class dialog box.
- From the Class type drop-down
list, select Generic Class.
- In the Name box,
specify the name of the new class.
The name you specify is reflected in the read-only File
name box, where the .cpp file is specified. By default, the header
file and the implementation file have the same name as the class file.
- To change the names of the header and
implementation files for this class, choose the Change button
and type the names into the Change Files dialog.
- To add the new class to existing
files, click Change, then click the Browse button
and locate the files you wish to add it to.
- Under Base Classes, in
the Derived From column, type the name of the base class
from which to derive the new class. In the As column,
click the access the new generic class is to have with regard to the base
class: public, protected, or private.
No comments:
Write comments