Help With List Boxes

Started by
3 comments, last by johnkull 20 years, 9 months ago
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); }
Advertisement
bump
Try stepping the code in the debugger and see where it screws up.
What kind of error?
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]

The nightmare travels across the cosmos with his burning mane. The trail of ash that is produced.

?Have a nice day!?

This topic is closed to new replies.

Advertisement