BUG: Finish Button Fails Data Transfer from Page to VariablesLast reviewed: June 26, 1997Article ID: Q150349 |
The information in this article applies to:
SYMPTOMSWhen you're using a wizard-style property sheet with DDX routines, data is not transferred from the current page to the corresponding variables when you click the Finish button.
CAUSEMFC relies on the PSN_KILLACTIVE notification handler, OnKillActive(), to call UpdateData(TRUE). This notification is not sent when you click the Finish button, so UpdateData(TRUE) is not called to allow data transfer by way of DDX.
RESOLUTIONWhen you click the Finish button, a PSN_WIZFINISH notification is sent. To allow the DDX routines to transfer data from the page to the corresponding variables, derive a class from CPropertyPage, and override the virtual function OnWizardFinish(). In OnWizardFinish(), place a call to UpdateData(TRUE).
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONWhen a user clicks the Back or Next button on a wizard page, the page loses the focus and consequently receives a PSN_KILLACTIVE notification message. When it receives the PSN_KILLACTIVE notification, the virtual function of the wizard page, OnKillActive(), calls UpdateData(TRUE). This call allows the DDX routines to transfer data from the page to the corresponding variables. However, when the Finish button is clicked, a PSN_KILLACTIVE notification is not sent, so UpdateData(TRUE) is not called.
Sample Code
/* Compile options needed: default */ BOOL CMyPropertyPage::OnWizardFinish() { if (!UpdateData()) //note: parameter is TRUE by default { TRACE0("UpdateData failed during wizard finish\n"); return FALSE; } return CPropertyPage::OnWizardFinish(); } |
Additional query words: CPropertySheet
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |