CPropertySheet & CPropertyPage
-
1. In MSDN, the disactive Page not initialize if you not click it, how can I initialize all page when the sheet is shown? 2. When I use the function "UpdateDialogControls" in a CPropertyPage, in Debug mode, it works perfectly, but in release mode, some warning will be shown, and the applications will destory, why?
-
1. In MSDN, the disactive Page not initialize if you not click it, how can I initialize all page when the sheet is shown? 2. When I use the function "UpdateDialogControls" in a CPropertyPage, in Debug mode, it works perfectly, but in release mode, some warning will be shown, and the applications will destory, why?
-
about 1: i don't understand your problem, Isn't all we need to addpage before creating the propertysheet? Then all the page you add will be shown.
In MSDN, the Method "AddPage"'s describe, MS told us "AddPage adds the CPropertyPage object to the CPropertySheet object’s list of pages but does not actually create the window for the page. The framework postpones creation of the window for the page until the user selects that page.", so if I don't click the page, the page's member can not be accessed or make a exception. But if I click the page, the "OnInitDialog" will be executed, so I can access the page's member when the sheet destory. so I need initialze the all pages when the sheet be shown, the all pages's "OnInitDialog" will be executed.
-
In MSDN, the Method "AddPage"'s describe, MS told us "AddPage adds the CPropertyPage object to the CPropertySheet object’s list of pages but does not actually create the window for the page. The framework postpones creation of the window for the page until the user selects that page.", so if I don't click the page, the page's member can not be accessed or make a exception. But if I click the page, the "OnInitDialog" will be executed, so I can access the page's member when the sheet destory. so I need initialze the all pages when the sheet be shown, the all pages's "OnInitDialog" will be executed.
-
During the constructor, modify the m_psp struct of the newly added property page in this way: this->m_YourPropertyPageDlg.m_psp.dwFlags |= PSP_PREMATURE; hope this helps.