Help With List Boxes
Hi,
I am having trouble reading a txt file and placing it in a list box. I am using MFC with MSVC++ 6. I have tried to read the strings from the file and add it directly to the list but I always get some strange errors by doing so. Below are some examples of what I have tried. Any ideas of what can be going wrong?
ifstream infile;
infile.open("c:\\data.txt");
string txt;
while(infile >> txt)
{
m_ListOne.AddString(txt);
}
/*******************************************/
ifstream infile;
infile.open("c:\\data.txt");
char txt[30];
while(infile >> txt)
{
m_ListOne.AddString(txt);
}
Try this.. http://www.egr.unlv.edu/~study077/mfclist.zip
I hope this helps
[edited by - GoofProg on July 4, 2003 1:49:02 AM]
I hope this helps
[edited by - GoofProg on July 4, 2003 1:49:02 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement