CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: File processing

  1. #1
    Join Date
    May 1999
    Posts
    136

    File processing

    Hi,
    I'm having trouble getting the right code to iterate through a file on disk. The file

  2. #2
    Join Date
    May 1999
    Posts
    36

    Re: File processing

    Hi,

    Need more info. Explain what you are trying to do...

    What are the vars declared as (I'm assuming CString and CStringList...).

    Maybe use CStdioFile instead of CFile. It can read in a line of text at a time (assuming you have text files with \n's ).

    If you use a CStdioFile, iterate like this


    for( ; ; ) // open loop
    {
    if(!mystdiofile.Read(szInBuffer))
    break; // eof (read returns number of chars read.... i think)

    m_aMyStringList.AddTain(szInBuffer);
    }




    HTH,



    Harvey Hawes

    Software Engineer
    BioScience Analysis Software Ltd.

    Masters Candidate
    Cardiovascular/Respiratory Sciences
    Faculty of Medicine
    University of Calgary
    Calgary, Alberta, Canada

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured