hi, all,
i have a class called CComboData, this class is to open a .txt file and retrieves the wordlist and store them in CStringArray variable, m_stringarray.
then, the combo box retrieves the strings stored in m_stringarray and display them,
say in the wordlist.txt file, the contents are:
hello
hi
how
good
thank
so the combo box displays:
hello
how
good
thank
there is a method called GetString in the CComboData class,
it is something like this:
CString CComboData::GetString(int i)
{
return m_stringarray.GetAt(i);}
in my dialog class,
i need to get what user selects, so i made my code like this:
dlg.m_combo_data.GetString(dlg.m_combo_box.GetCurSel());
m_combo_data is of type CComboData, and m_combo_box is of the type CComboBox.
but when i ran it, it gave an assert error:
saying ASSERT
:IsWindow(m_hWnd)); in the _AFXWIN_INLINE int CComboBox::GetCurSel() const function.
anyone can tell me what's wrong here?
THANKS A LOT!
kaya
i have a class called CComboData, this class is to open a .txt file and retrieves the wordlist and store them in CStringArray variable, m_stringarray.
then, the combo box retrieves the strings stored in m_stringarray and display them,
say in the wordlist.txt file, the contents are:
hello
hi
how
good
thank
so the combo box displays:
hello
how
good
thank
there is a method called GetString in the CComboData class,
it is something like this:
CString CComboData::GetString(int i)
{
return m_stringarray.GetAt(i);}
in my dialog class,
i need to get what user selects, so i made my code like this:
dlg.m_combo_data.GetString(dlg.m_combo_box.GetCurSel());
m_combo_data is of type CComboData, and m_combo_box is of the type CComboBox.
but when i ran it, it gave an assert error:
saying ASSERT
anyone can tell me what's wrong here?
THANKS A LOT!
kaya