Well, in short, im calling this function CMFCPropertySheet::AddPage()5 time with 5 CPropertyPage !
Now, all the 5 pages are added but not created as MSDN say:
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.
My Problem now is that My PropertySheet need to update an EditBox in one of those page, but that page isn't created yet, so also the EditBox !
It creates the page when you activate them by selecting that tab. If the tab isn't selected, the page isn't visible, so updating the edit control doesn't make sense. You could put your code in OnInitDialog or OnActivate for the appropriate page.
@GCDEF: with your way, samething happen, the control is still nto created since its part of the page !
@VictorN: of course i understand it, just you guys keep sayign samethings again and again !
The controls in that page are still NOT CREATED !
So im searchign an alternative way TO CREATE THEM and not waiting the user to click on the page !
All SetActivePage calls have returned "true" !
PS2: is there a way to create another CMFCPropertySheet withotu the dialog frame and locate it in another dialog ? (a smal size PropertySheet)
My way doesn't need the controls. Just use the variables that are associated with the controls that store the data. Set up members using the DDX mechanism to exchange data with the controls and use them instead of the controls directly.
Like GCDEF says, why don't you seperate the UI from the data ? All you need at initialization time is to make sure that the data in all the C++ objects representing the propertypages ( CPropertyPage objects ) properly populated. When the pages do get created , if ever, they simply show the data in the corresponding C++ object in the windows.