Microsoft KB Archive/832682

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

Article ID: 832682

Article Last Modified on 4/29/2007

-

APPLIES TO


 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual C++ 6.0 Standard Edition

-



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:

http://msdn2.microsoft.com/en-us/library/a6ys84zc(VS.80).aspx

Keywords: kbtshoot kbappwizard kbwizard kbcustomwizard kbcodesnippet kbpropsheet kbdocerr KB832682

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.