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

CDialog SetParent

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 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.
  • M Offline
    M Offline
    mcsherry
    wrote on last edited by
    #1

    I want to change the parent of a dialog so that its parent is the top level dialog (i.e. my main app). What is the correct way of doing this as when I get a pointer to the main dialog and use that the main app stops refreshing its display. What I want is something like this: MainApp->Modeless Dialog->Modeless Dialog->Modal Dialog attached to MainApp I can get this working by callbacks through the code but thought that by simply doing modal_dialog->SetParent ( main_app ) would have the same effect but it doesn't. cheers, Andy

    M 1 Reply Last reply
    0
    • M mcsherry

      I want to change the parent of a dialog so that its parent is the top level dialog (i.e. my main app). What is the correct way of doing this as when I get a pointer to the main dialog and use that the main app stops refreshing its display. What I want is something like this: MainApp->Modeless Dialog->Modeless Dialog->Modal Dialog attached to MainApp I can get this working by callbacks through the code but thought that by simply doing modal_dialog->SetParent ( main_app ) would have the same effect but it doesn't. cheers, Andy

      M Offline
      M Offline
      Maxwell Chen
      wrote on last edited by
      #2

      Use the ctor. CDialog::CDialog (MFC)[^]

      explicit CDialog(
      LPCTSTR lpszTemplateName,
      CWnd* pParentWnd = NULL
      );
      explicit CDialog(
      UINT nIDTemplate,
      CWnd* pParentWnd = NULL
      );


      Maxwell Chen

      M 1 Reply Last reply
      0
      • M Maxwell Chen

        Use the ctor. CDialog::CDialog (MFC)[^]

        explicit CDialog(
        LPCTSTR lpszTemplateName,
        CWnd* pParentWnd = NULL
        );
        explicit CDialog(
        UINT nIDTemplate,
        CWnd* pParentWnd = NULL
        );


        Maxwell Chen

        M Offline
        M Offline
        mcsherry
        wrote on last edited by
        #3

        :doh: thank you, should have thought of that myself rather than looking at more complicated ways of doing it. many thanks

        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