This topic is now archived and is closed to further replies.


Help With List Boxes

Recommended Posts

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;"c:\\data.txt"); string txt; while(infile >> txt) { m_ListOne.AddString(txt); } /*******************************************/ ifstream infile;"c:\\data.txt"); char txt[30]; while(infile >> txt) { m_ListOne.AddString(txt); }

Share this post

Link to post
Share on other sites