How do I make extra initializations on a modal dialog before calling DoModal(); ?
The whole application is created using VS wizards. I have a main Dialog (the one that is created automatically when I select new MFC Application in Visual Studio 2008 Professional).
When I click a button on this dialog I want to open another dialog and set a CString value into a CEdit control.my code:
...
void MainDlg::OnClicked开发者_高级运维ButtonX(){
   SecondDialogClass Dlg2;
   Dlg2.asocVar2Cedit.SetWindowTextW(L"my text");
   Dlg2.DoModal();
}
//asocVar2Cedit is the associeted control variable to the 
//CEdit control on the second Dialog (Right Click > Add Variable..  in VSC++)
...
this code generates at runtime a "Debug Assertion" error in winocc...
Any ideas ?
Thank you in advance.Add an OnInitDialog (WM_INITDIALOG) handler to your CDialog-derived class and have it initialise itself.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论