BUG: Finish Button Fails Data Transfer from Page to Variables

ID: Q150349


The information in this article applies to:


SYMPTOMS

When 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.


CAUSE

MFC 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.


RESOLUTION

When 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).


STATUS

Microsoft 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 INFORMATION

When 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 kbvc400bug kbvc410bug kbvc420bug kbvc500bug kbvc600bug


Keywords          : kbprg kbnokeyword kbMFC kbVC kbVC500bug kbVC600bug 
Version           : 4.0,4.1,4.2,5.0,6.0
Platform          : NT WINDOWS 
Issue type        : kbbug 

Last Reviewed: July 30, 1999