Thread: VC++ 5.0 Simple

    #1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    60
    Rep Power
    12

    VC++ 5.0 Simple


    Hello,
    Okay, I would like be able to display the contents of a text file from my VC++ exe file.

    I have created an edit box, which is where I would like the text for a file to be displayed.

    Thanks for you help.
    Sincerely,
    Ronald
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    3
    Rep Power
    0
    please can you give me the idea how to display the contents of a text from file
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    60
    Rep Power
    12

    Quick Update


    Here is some code that I just made. Okay this code take the text file, opens it up and stores it in m_EditBox. Now I want to take that string(I think it is a string) and display it in the form.

    Thanks


    CFile file1;
    file1.Open("C:\\list13.2.txt",CFile::modeCreate + CFile::modeNoTruncate);

    char cBuf[512];
    UINT uBytesRead;

    while (uBytesRead = file1.Read(cBuf, sizeof(cBuf)-1))
    {
    cBuf[uBytesRead] = NULL;
    m_EditBox += CString(cBuf);
    }
    //The entire file is contained here -> m_EditBox
    file1.Close();
    UpdateData(false);
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    60
    Rep Power
    12

    disclaimer


    Okay, Maybe I should give a small disclaimer about myself:
    I just started learning this on Monday. I do know C++ quite well, but not VC++.

IMN logo majestic logo threadwatch logo seochat tools logo