Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CPropertyPage problems continue...

CPropertyPage problems continue...

Scheduled Pinned Locked Moved C / C++ / MFC
questionsysadmindebugginghelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pmarki
    wrote on last edited by
    #1

    How can I use the hWnd of a property page? I created a CPropertyPage object in a thread (using new) and then used PostMessage() in order to call AddPage(CPropertyPage) from the main app thread. But then, I couldn't make any use of hWnd of that CPropertyPage,IsWindow(CPropertyPage->m_hWnd) returns false. PostMessage(msg,CPropertyPage->m_hWnd) and even CPropertyPage->UpdateData() fails (debug assertions). I need to use it this way, because I just wanted to have a set of dialogs groupped in property pages. I need to access the hWnd to use with PostMessage and WSAASyncSelect (as it will receive network notification) How can I do that? Maybe I am doing something wrong ? :eek: thanks for any help

    P 1 Reply Last reply
    0
    • P pmarki

      How can I use the hWnd of a property page? I created a CPropertyPage object in a thread (using new) and then used PostMessage() in order to call AddPage(CPropertyPage) from the main app thread. But then, I couldn't make any use of hWnd of that CPropertyPage,IsWindow(CPropertyPage->m_hWnd) returns false. PostMessage(msg,CPropertyPage->m_hWnd) and even CPropertyPage->UpdateData() fails (debug assertions). I need to use it this way, because I just wanted to have a set of dialogs groupped in property pages. I need to access the hWnd to use with PostMessage and WSAASyncSelect (as it will receive network notification) How can I do that? Maybe I am doing something wrong ? :eek: thanks for any help

      P Offline
      P Offline
      pmarki
      wrote on last edited by
      #2

      OK I know why it happens... it's because MFC postpones creation of a window until it's tab is selected by a user... Is there any possiblity to overcome that ie. to force mfc to create that window earlier and not wait for user selection ?

      L 1 Reply Last reply
      0
      • P pmarki

        OK I know why it happens... it's because MFC postpones creation of a window until it's tab is selected by a user... Is there any possiblity to overcome that ie. to force mfc to create that window earlier and not wait for user selection ?

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        lookig into source i see something like this used in another case but maybe it is what you need t! BOOL bResult = CPropertySheet::OnInitDialog(); int ActPage = GetActiveIndex(); for(int i = 0; i < GetPageCount(); i++) SetActivePage(i); SetActivePage(ActPage); //return back

        P 1 Reply Last reply
        0
        • L Lost User

          lookig into source i see something like this used in another case but maybe it is what you need t! BOOL bResult = CPropertySheet::OnInitDialog(); int ActPage = GetActiveIndex(); for(int i = 0; i < GetPageCount(); i++) SetActivePage(i); SetActivePage(ActPage); //return back

          P Offline
          P Offline
          pmarki
          wrote on last edited by
          #4

          This should work, but I'm afraid that the swap of active pages will be visible to the user (as this has to take place during runtime, and I think this code was used before the creation of CPropertySheet). Why did they prevent that stupid window from creating during AddPage ? anyway thank you, I will be trying...

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups