The sheet local variable is incorrectly declared in the Help topic for the CPropertyPage::OnWizardFinish function (832682)



The information in this article applies to:

  • Microsoft Visual C++, 32-bit Enterprise Edition 6.0
  • Microsoft Visual C++, 32-bit Professional Edition 6.0
  • Microsoft Visual C++, 32-bit Learning Edition 6.0

SUMMARY

In the Microsoft Foundation Classes (MFC) documentation on the MSDN Web site, the Help topic for the CPropertyPage::OnWizardFinish function incorrectly declares the sheet local variable. After you add this code sample to your project, the program may not be successful and access violation errors may occur. This problem occurs when you try to use the part of the OnWizardNext code sample that adds a wizard page to the set of wizard pages.

CAUSE

This problem occurs because the code sample does not specifically state that you should not use the base class. Instead, use the CPropertySheet-derived application class.

MORE INFORMATION

The Help topic incorrectly declares the sheet local variable as follows:
 CPropertySheet* sheet = (CPropertySheet*) GetParent();
Declare the sheet local variable as a variable of the CPropertySheet-derived application class of your project. For example, if CMyPropertySheet is your CPropertySheet-derived application class, declare the sheet variable as follows:
   CMyPropertySheet* sheet = (CMyPropertySheet*) GetParent();
For more information about the CPropertyPage::OnWizardNext function, visit the following Microsoft Web site:

Modification Type:MinorLast Reviewed:7/21/2004
Keywords:kbtshoot kbAppWizard kbwizard kbCustomWizard kbCodeSnippet kbPropSheet kbdocerr KB832682 kbAudDeveloper