Jump to content
  • Advertisement

Archived

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

johnkull

Help With List Boxes

This topic is 5584 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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; 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); }

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
bump

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Try stepping the code in the debugger and see where it screws up.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!