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