Populating ComboBoxes assertion error
Posted on 1998-12-24
I have a single document form, and I have 2 resource dialogs which I have created. I have linked them doing the following
// TODO: Add your control notification handler code here
m_ComboMain.AddString(0,"hi"); //ComboMain is an a member of type CCombo and control
m_ListMain.AddString("hi"); //ListBox is the same as CCombo, except CListBox type and control.
Both give me assertion errors.
// CSubDlg subDlg;
the best way to emulate the problem, is to create new project, single document, database DAO pick any database you have and the rest is abatary, (dynaset, dirty dtect)
Now create the form1 with 2 controls on it
a button: which will popup DIALOG1 and populate Mainfrm's combo and Dialog1's Combo.
a combobox: m_ComboMain which is a control;
in the Dialog1
a button: which will populate the Combobox, (and the MainFrms one.)
a comboBox: m_ComboDialog1;
Now populate what ever you populate like this
if from form1 to Dialog1, say AddString("Mainfrm to Dialog1")
if from form1 to its own one ("MainFrm to Mainform") in that way.
Please be a simple as can be. I get an assertion error doing...
dlg1->m_ComboDialog1.AddString("From Mainfrm to Dialog1");
Please any help will be appreciated.
I will increase the points for a working answer. Please do the emulation.
Thank you very much in advance.
(I don't really think that a question can be plainer)
A simple way to populate ComboDialog1 and ComboMain from both them selves and to each other.