Archived

This topic is now archived and is closed to further replies.

remi

Modal dialog boxes

Recommended Posts

Hi all, i have a question concerning MFC. I built a dialog box with the VC''s resource editor. The dialog box has a CComboBox and i''ve already filled the data in but when call the DoModal() function nothing appears in the combo box. The worst thing is when i attempt to fill it(the combo box)dynamically, the program just crashes. PLZ help!

Share this post


Link to post
Share on other sites
Here are some codes

//...
CRoomProp Dlg;//here we create a dialog box
//cLanguage is a CComboBox control, member of CRoomProp.
Dlg.cLanguage.AddString("English");//the program crashes here
Dlg.cLanguage.AddString("French");
if( IDCANCEL == Dlg.DoModal() )
//...

Share this post


Link to post
Share on other sites
I figured out that the initialization of the item on the dialog box should be put within the function CDialog::OnInitialize(...)

thanx anyway!

[edited by - remi on November 23, 2003 10:11:56 AM]

Share this post


Link to post
Share on other sites