CMFCPropertySheet::AddPage doesn't Create Dlg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 23

Thread: CMFCPropertySheet::AddPage doesn't Create Dlg

  1. #1
    Join Date
    Jul 2007
    Posts
    213

    Exclamation 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 !


  2. #2
    Join Date
    Jul 2007
    Posts
    213

    Re: CMFCPropertySheet::AddPage doesn't Create Dlg

    No one know the solution ???

  3. #3
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,301

    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

  4. #4
    Join Date
    Jul 2007
    Posts
    213

    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 !

  5. #5
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,057

    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.

  6. #6
    Join Date
    Jul 2007
    Posts
    213

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

  7. #7
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,301

    Re: CMFCPropertySheet::AddPage doesn't Create Dlg

    Quote Originally Posted by yoni1993 View Post
    OMG !!!

    Guys, if the user wont click on the tab for the first time , that tab wont be created !!!
    Correct!

    Quote 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?

    Quote Originally Posted by yoni1993
    Must be a function to create it manually...
    CPropertySheet::SetActivePage
    Victor Nijegorodov

  8. #8
    Join Date
    Jul 2007
    Posts
    213

    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 09:44 AM.

  9. #9
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,301

    Re: CMFCPropertySheet::AddPage doesn't Create Dlg

    Quote Originally Posted by yoni1993 View Post
    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?

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

    Quote 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

  10. #10
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,057

    Re: CMFCPropertySheet::AddPage doesn't Create Dlg

    Why don't you use the member variables associated with the controls instead of the controls themselves?

  11. #11
    Join Date
    Jul 2007
    Posts
    213

    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

  12. #12
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,057

    Re: CMFCPropertySheet::AddPage doesn't Create Dlg

    Quote Originally Posted by yoni1993 View Post
    @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.

  13. #13
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,301

    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

  14. #14
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    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.

  15. #15
    Join Date
    Jul 2007
    Posts
    213

    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 !

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center