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. vc++ 6 mfc, dialog with child, messed up

vc++ 6 mfc, dialog with child, messed up

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

    i have a main dialog with some controls, i also have a second dialog(modeless) and i want to make it into child. when selected style "popup" in the child dlg properties the "child" dlg acts normal, but its not what i want, because i only want the child dlg to appear inside the main dlg, not anywhere else on the screen. opening the child dlg, when selected style "child" in the dlg properties, the main dlg gets painted onto the child dlg making it a transparent mess. how can i get the "child" dlg to be painted correctly? this is the code that opens the modeless "child" dlg: void CMyApp::OpenChDlg() { CChildDlg *dlg; dlg = new CChildDlg; dlg->Create(IDD_CHILDDLG); dlg->ShowWindow(true); } thx

    M D 2 Replies Last reply
    0
    • R rolfhorror

      i have a main dialog with some controls, i also have a second dialog(modeless) and i want to make it into child. when selected style "popup" in the child dlg properties the "child" dlg acts normal, but its not what i want, because i only want the child dlg to appear inside the main dlg, not anywhere else on the screen. opening the child dlg, when selected style "child" in the dlg properties, the main dlg gets painted onto the child dlg making it a transparent mess. how can i get the "child" dlg to be painted correctly? this is the code that opens the modeless "child" dlg: void CMyApp::OpenChDlg() { CChildDlg *dlg; dlg = new CChildDlg; dlg->Create(IDD_CHILDDLG); dlg->ShowWindow(true); } thx

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      To be a child, doesn't the child need a parent? What about passing a valid parent to Create()? Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      R 1 Reply Last reply
      0
      • M Mark Salsbery

        To be a child, doesn't the child need a parent? What about passing a valid parent to Create()? Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        R Offline
        R Offline
        rolfhorror
        wrote on last edited by
        #3

        thanx, but how do i find the name of the parent? ive tried some of my class names and so on.. i tried to find it in CWnd *pParent and the main dlg class, but i cant get a hold of it, ..errors.. even tried this: made a global var at the start of maindlg: CWnd* pParentWnd = CWnd::GetActiveWindow(); stored in pParentWnd CChildDlg *dlg; dlg = new CChildDlg; dlg->Create(IDD_CHILDDLG, pParentWnd); dlg->ShowWindow(true); // works fine until move the mouse, then messed up and its overpainted by the maindlg.. theres something im missing.. thx

        modified on Wednesday, August 6, 2008 4:22 PM

        M 1 Reply Last reply
        0
        • R rolfhorror

          i have a main dialog with some controls, i also have a second dialog(modeless) and i want to make it into child. when selected style "popup" in the child dlg properties the "child" dlg acts normal, but its not what i want, because i only want the child dlg to appear inside the main dlg, not anywhere else on the screen. opening the child dlg, when selected style "child" in the dlg properties, the main dlg gets painted onto the child dlg making it a transparent mess. how can i get the "child" dlg to be painted correctly? this is the code that opens the modeless "child" dlg: void CMyApp::OpenChDlg() { CChildDlg *dlg; dlg = new CChildDlg; dlg->Create(IDD_CHILDDLG); dlg->ShowWindow(true); } thx

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          rolfhorror wrote:

          ...i only want the child dlg to appear inside the main dlg, not anywhere else on the screen.

          Something like this?

          "Love people and use things, not love things and use people." - Unknown

          "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

          1 Reply Last reply
          0
          • R rolfhorror

            thanx, but how do i find the name of the parent? ive tried some of my class names and so on.. i tried to find it in CWnd *pParent and the main dlg class, but i cant get a hold of it, ..errors.. even tried this: made a global var at the start of maindlg: CWnd* pParentWnd = CWnd::GetActiveWindow(); stored in pParentWnd CChildDlg *dlg; dlg = new CChildDlg; dlg->Create(IDD_CHILDDLG, pParentWnd); dlg->ShowWindow(true); // works fine until move the mouse, then messed up and its overpainted by the maindlg.. theres something im missing.. thx

            modified on Wednesday, August 6, 2008 4:22 PM

            M Offline
            M Offline
            Mark Salsbery
            wrote on last edited by
            #5

            You're the one that creates all the windows. You should be able to get a CWnd * somewhere. I'm not sure what the problem is here. Mark

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            R 1 Reply Last reply
            0
            • M Mark Salsbery

              You're the one that creates all the windows. You should be able to get a CWnd * somewhere. I'm not sure what the problem is here. Mark

              Mark Salsbery Microsoft MVP - Visual C++ :java:

              R Offline
              R Offline
              rolfhorror
              wrote on last edited by
              #6

              i have some updateData(),updatewindow(), and a "SetWindowPos(&wndTopMost,NULL,NULL,NULL,NULL,SWP_NOMOVE|SWP_NOSIZE);" funcs in the maindlg, maybe thats why the childdlg get overpainted? but i dont have it enabled on mousemove func.. strange.

              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