A Bug with MFC Aero Wizards ?
-
I am using MFC 9.0 to create Aero Wizard on Vista. Evrything seems to be OK : creating a prpertysheet, setting the PSH_AEROWIZARD, adding propertypages, etc. However the next and back buttons only work when the following functions of the currently active page are returning the zero value :
LRESULT OnWizardNext();
LRESULT OnWizardBack();
When the return value is zero, the framework uses the order by which the developer called CPropertySheet::AddPage for each page instance as an information rules for navigation. However, the developer is allowed, according to the application logic, to override those function and return the dialog resource ID of specific page. That case, the framework navigates to this latter one instead of the default page. example :
LRESULT CPage1::OnWizardNext()
{
// TODO: Add your specialized code here and/or call the base class
return CPage3::IDD;
}When the PSH_AEROWIZARD flag is set, unfortunately, this is not accepted : the next and back button do not work. What's going on ? Is this a bug ? In this case, is there a way how I can intercept the next and back clicks so I can make explicit calls to CPropertySheet::SetActivePage ? Thank you in advance.
Easy Profiler : Now open source ! http://www.codeproject.com/KB/cpp/easyprofiler.aspx
-
I am using MFC 9.0 to create Aero Wizard on Vista. Evrything seems to be OK : creating a prpertysheet, setting the PSH_AEROWIZARD, adding propertypages, etc. However the next and back buttons only work when the following functions of the currently active page are returning the zero value :
LRESULT OnWizardNext();
LRESULT OnWizardBack();
When the return value is zero, the framework uses the order by which the developer called CPropertySheet::AddPage for each page instance as an information rules for navigation. However, the developer is allowed, according to the application logic, to override those function and return the dialog resource ID of specific page. That case, the framework navigates to this latter one instead of the default page. example :
LRESULT CPage1::OnWizardNext()
{
// TODO: Add your specialized code here and/or call the base class
return CPage3::IDD;
}When the PSH_AEROWIZARD flag is set, unfortunately, this is not accepted : the next and back button do not work. What's going on ? Is this a bug ? In this case, is there a way how I can intercept the next and back clicks so I can make explicit calls to CPropertySheet::SetActivePage ? Thank you in advance.
Easy Profiler : Now open source ! http://www.codeproject.com/KB/cpp/easyprofiler.aspx
MFC 9.0 assumes that the Parent() of the CPropertyPage is the CPropertySheet. With the Aero Wizards, that's not the case, there are two other HWNDs in between. Therefore, the code in CPropertyPage::MapWizardResult() that tries to find the CPropertySheet to do the conversion from resource ID to PROPSHEETPAGE_RESOURCE doesn't run. You will need to do the conversion yourself.