HOWTO: How to Use the ClassWizard with 16-Bit Property Pages

ID: Q130947

The information in this article applies to:

SUMMARY

The Class Wizard included with Visual C++ version 1.52 does not support adding a class derived from CPropertyPage. It is possible however to add and maintain a CPropertyPage derived class with the Class Wizard by adding a class derived from CDialog and manually replacing all instances of CDialog with CPropertyPage.

MORE INFORMATION

To add a CPropertyPage derived class to a project using the ClassWizard:

1. Create a dialog template for the property page using the App Studio.

2. With the dialog template as the active object in the App Studio, invoke

   the Class Wizard. An Add Class dialog box appears.

3. Select names for your new class and its files. Leave the Class Type as
   CDialog.

4. Choose the Create Class button.

5. Open the .CPP and .H files created in the previous step, and replace all

   instances of CDialog with CPropertyPage.

6. Locate the constructor for the newly created property page and remove
   the second parameter (pParent) from the call to the base class
   CPropertyPage constructor.

Step 6 is necessary because the second parameter of the CPropertyPage constructor is not the same as that for the CDialog constructor. Removing the second parameter forces the caption for the property page to be taken from the dialog template for the page. An alternative would be to specify a resource ID for a caption as the second parameter in the call to the base class CPropertyPage constructor.

Additional query words: kbvc152

Keywords          : kb16bitonly
Technology        : kbMfc

Last Reviewed: August 21, 1998