Click to See Complete Forum and Search --> : How to read file in VC++6.0


Yoh-hei
March 28th, 1999, 10:08 PM
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!

murali_b
March 20th, 2001, 02:13 AM
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