Solved

listbox.addstring error, why?

Posted on 1998-07-14
3
198 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
  • 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

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 …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now