CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    79

    How to read file in VC++6.0



    Hello:

    I have a question.

    There is a data file include math and word.I want

    use VC++6.0 read it.I known VC++6.0 auto made.Serialize()

    can read the filein doc class.And then how to do.And if

    i can use it in view class?

    Thank you very much!

  2. #2
    Join Date
    Mar 2001
    Location
    India
    Posts
    2

    Re: How to read file in VC++6.0

    Hi,
    I didn't understand what u want to read. Whether u want to read a file from hard disk or asking about the doc/view architecture.....anyway..

    If u want to read a file from the hard disk, u will have to use the CFile or CStdioFile class of MFC. Create it like this
    CStdioFile *pFile = new CFile(<filename>. CStdioFile::modeCreate| CFile::modeReadWrite);
    pFile->ReadString(<buffer>

    If u want data from the doc class in the view class use the GetDocument member function of CView class, this returns a pointer of the CDocument class that ur wizard created.

    regards,

    Murali.B


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