tirips
asked on
listbox.addstring error, why?
all i'm trying to do was use a dialog box to ask what to open an unknown file type as, and i'm fairly sure it is the add string that is doing it. when i comment them out (making it pointless) it works fine, minus the text.
if ((type != typeA) | (type != typeB) | (type != typeC))
{
COpenAs dlg; // a dialog box with a list box and an ok and cancel button
// and used the class wiz to link CListBox m_File_Type to
// the dialog box list box no other noteable changes made
dlg.m_File_Type.AddString( "Type A"); // *******puts error here
dlg.m_File_Type.AddString( "Type B");
dlg.m_File_Type.AddString( "Type C");
dlg.m_File_Type.SetCurSel( 0);
if (dlg.DoModal() == IDOK)
if (dlg.m_File_Type.GetCurSel () != LB_ERR)
type = dlg.m_File_Type.GetCurSel( ) + 1;
}
if ((type != typeA) | (type != typeB) | (type != typeC))
{
COpenAs dlg; // a dialog box with a list box and an ok and cancel button
// and used the class wiz to link CListBox m_File_Type to
// the dialog box list box no other noteable changes made
dlg.m_File_Type.AddString(
dlg.m_File_Type.AddString(
dlg.m_File_Type.AddString(
dlg.m_File_Type.SetCurSel(
if (dlg.DoModal() == IDOK)
if (dlg.m_File_Type.GetCurSel
type = dlg.m_File_Type.GetCurSel(
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks tirips!
ASKER