Files in MFC

OverviewHow Do I

In the Microsoft Foundation Class Library (MFC), class handles normal file I/O operations. This family of articles explains how to open and close files as well as read and write data to those files. It also discusses file status operations. For a description of how to use the object-based serialization features of MFC as an alternative way of reading and writing data in files, see the article Serialization (Object Persistence).

Note   When you use MFC CDocument objects, the framework does much of the serialization work for you. In particular, the framework creates and uses the CFile object. You only have to write code in your override of the Serialize member function of class CDocument.

The CFile class provides an interface for general-purpose binary file operations. The CStdioFile and CMemFile classes derived from CFile and the CSharedFile class derived from CMemFile supply more specialized file services.

What do you want to know more about?