How to Use the ClassWizard with 16-Bit Property Pages

Last reviewed: July 22, 1997
Article ID: Q130947
1.52 WINDOWS kbtool

The information in this article applies to:

  • The ClassWizard included with: Microsoft Visual C++ for Windows, version 1.52

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 reference words: kbinf 1.52 2.52
KBCategory: kbtool
KBSubcategory: WizardIss
Keywords : kb16bitonly
Technology : kbMfc


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.