Solved

listbox.addstring error, why?

Posted on 1998-07-14
3
206 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 50 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 111
Separate into files by filename 12 91
VBA "SendKeys" Syntax for Multiple Keystrokes 7 125
Change to event 1 128
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

756 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