I have two dialogs as I told before.there is a combo box in the first dialog.i have a text box in the second dialog.when i click a button, i get the second dialog in which the text box is present.i get the data in the text box in the combo box when i click the ok button .have written code for that.my problem is , i have to see all the data that i enter in the text box in the second dialog into the combo box in first dialog.now what happens is, i can only see the last entered item.i have written it i the OnOK function ,but have commented CDialog::OnOk();
I need to enter details as long as i want and see them all in the first combo box. what to do?
Code in second dialog:
CString i;
fstream f;
f.open("C:\\myfile.txt",ios::app);
printf("\n");
GetDlgItemText(IDC_EDIT2,str_name);
f.write(str_name.GetBuffer(str_name.GetLength()),str_name.GetLength());
f<<endl;
m_combo.AddString(str_name);
m_edit3.SetWindowText(_T(""));
f.close();
in first dialog:
Add cd;
cd.DoModal();
m_selcam.AddString(cd.str_name);