Doing extra initialisations on a MFC Dialog in Visual Studio 2008 Pro

Posted by theunanonim on Stack Overflow See other posts from Stack Overflow or by theunanonim
Published on 2010-05-29T17:38:33Z Indexed on 2010/05/29 17:42 UTC
Read the original article Hit count: 323

Filed under:
|

How do I make extra initializations on a modal dialog before calling DoModal(); ?

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 OnClickedButtonX(){
   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 a "Debug Assertion" error in winocc...

Any ideas ?
Thank you in advance.

© Stack Overflow or respective owner

Related posts about c++

Related posts about mfc