Home > Software engineering > MFC dialog - how to get child dialog the default value of each control, please answer
MFC dialog - how to get child dialog the default value of each control, please answer
Time:11-25
Due to this problem bothering me for a long time, so I write the detailed point, ask and answer Manufacturer to provide the demo, is in the main dialog box for the main form of the various controls on the default values, such as some initialization time to write in the address what of, equipment type, etc.; Now I want to change in the child form, is I now have a main form, set up a button on the main form, click on this button, you can pop up child form, and then add in child form manufacturer to provide the code, add code when they encounter a problem; The original code used in a statement:=(CAtPipDlg *) AfxGetApp CAtPipDlg * DLG () - & gt; GetMainWnd (); CAtPipDlg is main form class, through the words, write a lot of value in the pointer DLG, some of them I need the list of most control control, at the same time I also want to write something here; But now I want to use in the child form, in using the words above, completely get less than child form the default values of each control, and the corresponding w_hWnd CListCtrl class handles the corresponding address is 0 x00000000, if I want to be in child form similar to that in the CAtPipDlg=(CAtPipDlg *) * DLG AfxGetApp () - & gt; GetMainWnd (); The function of the words, how can I modify, o Daniel,
CodePudding user response:
I've tried GetForegroundWindow (); The GetActiveWindow (); Take less than the desired result;
CodePudding user response:
Use the Create Create (non-modal) or DoModal (modal) Similar DLG CAtPipDlg *=new CAtPipDlg; DLG - & gt; DoModal (); The delete DLG.