I typically store the strings for the combo box in a CStringArray and pass a
the control in the OnInitDialog() function in dialog B. You can retrieve
selection changes. The variable will persist even after the dialog (B) is
closed so you can retrieve it after.
Okay, I can set other controls just fine...its this darn combo box giving
me a problem.
"Nobody" <Nobody@yahoo.com> wrote in message
news:u%23zz2DJ3HHA.6128@TK2MSFTNGP02.phx.gbl...
Hi,
First, your probably not familiar with Control variables.
http://www.flounder.com/getdlgitem.htm
I have not used GetDlgItem(IDC_TESTBOX) in years.
So, it behooves you to learn to use control variables instead.
Then, this is what you do.
Dlg.m_Combo.SetItem()
I don't like doing it that way,
instead, I have a private member variable
private:
CCombobox m_Combo;
public:
CComboBox* GetComboBox() { return & m_Comb; }
Then, I do this instead.
Dlg.GetCombo()->SetItem()
HTH,
"Scott Kraemer" <skraemer8@cox.net> wrote in message
news:emOLYwI3HHA.600@TK2MSFTNGP05.phx.gbl...
Lets say I have dialog A. On dialog A, I have a button that opens Dialog
B.
I want to be able
to set the control values of a combo box of values from Dialog A.
I tried setting them before the doModal(), but I keep getting assertion
errors.
emailDLG dlg;
CComboBox* test = (CComboBox*)dlg.GetDlgItem(IDC_TESTBOX);
test->AddString("test1"):
test->AddString("test2"):
if (dlg.DoModal() !=IDCANCEL) {
.
...
.....
Thanks in advance!
Scott