must CListBox::InsertString() be called on the dialog's onInitDialog?
Posted on 2005-04-05
I have a dialog, on there it has a listbox, with a control called m_output;
I have another class, that calls the parent class (that contains an obj of the dialog)...and I want to print out some data to the list box inside this class:
// crashes on this line
// note: m_output is a CListBox
// m_child is an object of a dialog
// someclass is not a dialog, just a regular class
((CMainDlg*)AfxGetMainWnd())->m_child.m_output.InsertString(-1, "my string"); }
am I not initializing something somewhere to cause it to crash?