-
November 10th, 2008, 12:54 AM
#1
CMFCPropertySheet::AddPage doesn't Create Dlg
Hello guys
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 !
How can i create the pages window manually ?
Thanks from advance !
-
November 10th, 2008, 05:58 AM
#2
Re: CMFCPropertySheet::AddPage doesn't Create Dlg
No one know the solution ???
-
November 10th, 2008, 06:05 AM
#3
Re: CMFCPropertySheet::AddPage doesn't Create Dlg
You cannot update "an EditBox in one of those page" that does NOT exist yet.
You, however, can update the text you are going to display in this box.
Victor Nijegorodov
-
November 10th, 2008, 08:03 AM
#4
Re: CMFCPropertySheet::AddPage doesn't Create Dlg
I know i cannot update that EditBox which isnt created yet.
But since i am loading configs and i will need to update many controls to their config stats !!!
and also its not an editboc but a listview...
Creating the page (window) manually would be great !
-
November 10th, 2008, 08:14 AM
#5
Re: CMFCPropertySheet::AddPage doesn't Create Dlg
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.
-
November 10th, 2008, 09:54 AM
#6
Re: CMFCPropertySheet::AddPage doesn't Create Dlg
OMG !!!
Guys, if the user wont click on the tab for the first time , that tab wont be created !!!
So i want to create it manually and not waiting for the user to do it !
Must be a function to create it manually...
-
November 10th, 2008, 10:00 AM
#7
Re: CMFCPropertySheet::AddPage doesn't Create Dlg
Originally Posted by yoni1993
OMG !!!
Guys, if the user wont click on the tab for the first time , that tab wont be created !!!
Correct!
Originally Posted by yoni1993
So i want to create it manually and not waiting for the user to do it !
Why do you think you need it?
Originally Posted by yoni1993
Must be a function to create it manually...
CPropertySheet::SetActivePage
Victor Nijegorodov
-
November 10th, 2008, 10:41 AM
#8
Re: CMFCPropertySheet::AddPage doesn't Create Dlg
I need it casue i need to access to the controls which are located in that page !
if the page isnt created. so also the controls !
And i cant use alternate ways since here i am talking about more than 40~ controls !
+ some logs ListView which im writing to them sometimmes...
PS: i called SetActivePage to every page, and its still didnt create them !!! (excpect the one i see currently [the last SetActivePage called page] )
its so hard to create them manually :S ???
Last edited by yoni1993; November 10th, 2008 at 10:44 AM.
-
November 10th, 2008, 10:57 AM
#9
Re: CMFCPropertySheet::AddPage doesn't Create Dlg
Originally Posted by yoni1993
I need it casue i need to access to the controls which are located in that page !
if the page isnt created. so also the controls !
It does not make any sense!
You cannot access something that does NOT exist!
And why don't you want to understand it?
Originally Posted by yoni1993
And i cant use alternate ways since here i am talking about more than 40~ controls !
+ some logs ListView which im writing to them sometimmes...
It does NOT matter how many controls are there: one or "more than 40~".
The only thing that matters is whether it/they exist(s) or not.
Originally Posted by yoni1993
PS: i called SetActivePage to every page, and its still didnt create them !!! (excpect the one i see currently [the last SetActivePage called page] )
its so hard to create them manually :S ???
What is/were the return value(s) of SetActivePage call(s)?
Where did you call it from?
Show your code.
Victor Nijegorodov
-
November 10th, 2008, 11:00 AM
#10
Re: CMFCPropertySheet::AddPage doesn't Create Dlg
Why don't you use the member variables associated with the controls instead of the controls themselves?
-
November 10th, 2008, 11:12 AM
#11
Re: CMFCPropertySheet::AddPage doesn't Create Dlg
@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)
Thanks
-
November 10th, 2008, 11:20 AM
#12
Re: CMFCPropertySheet::AddPage doesn't Create Dlg
Originally Posted by yoni1993
@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)
Thanks
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.
-
November 10th, 2008, 11:21 AM
#13
Re: CMFCPropertySheet::AddPage doesn't Create Dlg
I ask you again: Why do you think you need it (to create property pages before user activates them)?
So im searchign an alternative way TO CREATE THEM
...
All SetActivePage calls have returned "true" !
Could you show your code?
Victor Nijegorodov
-
November 10th, 2008, 02:23 PM
#14
Re: CMFCPropertySheet::AddPage doesn't Create Dlg
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.
-
November 11th, 2008, 02:19 AM
#15
Re: CMFCPropertySheet::AddPage doesn't Create Dlg
@kirants, GCEDF: well, they doesnt !. i have some sontrols which are acting as a listview (report), and im writing to it about every 500ms.
PLEASE dont ask why, I JUST NEED IT THATS ALL !
so i need to create the pager manually and not waiting the user to create it !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|