[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

listbox.addstring error, why?

Posted on 1998-07-14
3
Medium Priority
?
211 Views
Last Modified: 2013-11-20
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;
}
0
Comment
Question by:tirips
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:tirips
ID: 1319127
Edited text of question
0
 
LVL 7

Accepted Solution

by:
psdavis earned 200 total points
ID: 1319128
At this point, the listbox isn't created.  Override the WM_INITDIALOG and put the add strings in there.

Phillip

0
 
LVL 7

Expert Comment

by:psdavis
ID: 1319129
Thanks tirips!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question