interesting problem
-
hello @all, i have a dialogbased program. there a two buttons (eg. button1 and button2). if i press button1 first i get a new dialog (ID_DIALOG_COMBO) with a combobox (
m_ctrlComboBox
). if i press the button2 a CString (CString mystring
) should be enterd into the combobox from the ID_DIALOG_COMBO. how can i do this???? thank you very much this is only an example, to explain the real background would be take to much time sunny -
hello @all, i have a dialogbased program. there a two buttons (eg. button1 and button2). if i press button1 first i get a new dialog (ID_DIALOG_COMBO) with a combobox (
m_ctrlComboBox
). if i press the button2 a CString (CString mystring
) should be enterd into the combobox from the ID_DIALOG_COMBO. how can i do this???? thank you very much this is only an example, to explain the real background would be take to much time sunnyLooks like you need a modeless dialog. Take a look at Nish's tutorial.. http://www.codeproject.com/dialog/gettingmodeless.asp[^]
-
hello @all, i have a dialogbased program. there a two buttons (eg. button1 and button2). if i press button1 first i get a new dialog (ID_DIALOG_COMBO) with a combobox (
m_ctrlComboBox
). if i press the button2 a CString (CString mystring
) should be enterd into the combobox from the ID_DIALOG_COMBO. how can i do this???? thank you very much this is only an example, to explain the real background would be take to much time sunny -
hello @all, i have a dialogbased program. there a two buttons (eg. button1 and button2). if i press button1 first i get a new dialog (ID_DIALOG_COMBO) with a combobox (
m_ctrlComboBox
). if i press the button2 a CString (CString mystring
) should be enterd into the combobox from the ID_DIALOG_COMBO. how can i do this???? thank you very much this is only an example, to explain the real background would be take to much time sunny -
hello @all, i have a dialogbased program. there a two buttons (eg. button1 and button2). if i press button1 first i get a new dialog (ID_DIALOG_COMBO) with a combobox (
m_ctrlComboBox
). if i press the button2 a CString (CString mystring
) should be enterd into the combobox from the ID_DIALOG_COMBO. how can i do this???? thank you very much this is only an example, to explain the real background would be take to much time sunnyI would create the dialog in a thread, use a CStringArray for the contents of the combo box and create a function to refresh the combo. _beginthread( ShowDialog, 0, ID_DIALOG_COMBO ); LRESULT ShowDialog( LPVOID pVoid ) { CDialog Dlg; Dlg.Create( pVoid ); Dlg.DoModal(); return TRUE; } or CMyDialog* pDlg = new CMyDialog; pDlg->... // initialize members _beginthread( ShowDialog, 0, (void*)pDlg ); LRESULT ShowDialog( LPVOID pVoid ) { CDialog* pDlg = (CDialog*)pVoid ; pDlg->DoModal(); delete pDlg; return TRUE; } The pointer method is preferable because you can store the pointer(s) and control the dialog using these pointers. Make a function to refresh your combo and call it through any initialized pointers. Maybe use a CPtrArray.