CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    Join Date
    Mar 2011
    Posts
    14

    Re: Reading Text line from .txt File

    hypheni : Can you tell me any which is related to the Windows Programming.?
    Iwil be very very thankful to you
    VictorN: Thanks Buddy so nice of you

  2. #17
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: Reading Text line from .txt File

    Any what book ?.

    then start off with this.
    ◄◄ hypheni ►►

  3. #18
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Reading Text line from .txt File

    Quote Originally Posted by adnan86 View Post
    CStdioFile inFile;
    CFileException efile;
    CString strFirstLine;
    inFile.Open("test.txt",CFile::modeRead|CFile::typeText);
    inFile.ReadString(strFirstLine);

    m_List1.AddString(inFile);


    am doing this , but giving me error
    Nevertheless, it's still the best approach. Getting and fixing errors is part of programming. Why are you passing a CStdilFile to your list? The compiler probably told you exactly what was wrong.

    You're still just guessing and that still isn't working for you.
    Last edited by GCDEF; March 25th, 2011 at 07:12 AM.

  4. #19
    Join Date
    Jul 2010
    Posts
    94

    Re: Reading Text line from .txt File

    Hey, why not try CFile ? Cstdiofile is different from cfile

  5. #20
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Reading Text line from .txt File

    Quote Originally Posted by Sharpie View Post
    Hey, why not try CFile ? Cstdiofile is different from cfile
    How would that help in this situation?

  6. #21
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Reading Text line from .txt File

    Quote Originally Posted by Sharpie View Post
    Hey, why not try CFile ? Cstdiofile is different from cfile
    1. Yes. CStdioFile is different from CFile, however, it is derived from CFIle.
    2. None of CFile methods takes CString as a parameter, however CStdioFile::ReadString and CStdioFile::WriteString do. And it is what OP needs!
    Victor Nijegorodov

Page 2 of 2 FirstFirst 12

Tags for this Thread

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