We can simply save some text content as a file. however, it is complicated to save some Class Object Information and initialize a Class Object with that information during reading. MFC provides a function called serialization. you can convert an object information into a binary file (or an xml file) and save it. the following is a simple example. If there is a CArwen class, instantiate an object and serialize it. finally, deserialization is performed to read the saved values and initialize them to an object. 1. first define the class CArwen // header file class CArwen: public CObject {DECLARE_SERIAL (CArwen) public: virtual void Serialize (CArchive & ar); int age; CString name ;}; // cpp file IMPLEMENT_SERIAL (CArwen, CObject, 1) // 1 is the version number. You can specify a value void CArwen: Serialize (CArchive & ar) {if (ar. isStoring () {// serialize and save the information. CArchive: store corresponds to this ar <age; ar <name;} else // deserialization, read information {ar> age; ar> name ;}} 2. test procedure # include "CArwen. h "CString filePath = _ T (" D: \ app \ Arwen. dat "); // serialize the object information stored in the file void TestSerializeArwen () // Save the information {CArwen arwen; arwen. age = 24; arwen. name = _ T ("weiwenhp); // If unicode is not used, _ T CFile fi; fi is not used. open (filePath, CFile: modeCreate | CFile: modeWrite); // if the file does not exist, create one. Otherwise, write data to the file www.2cto.com CArchive ar (& fi, CArchive :: store); awen. serialize (ar); // Serialize the object ar. close (); fi. close ();} void TestReadSerilizedArwn () // read information {CArwen arwen; CFile fi; fi. open (filePath, CFile: Read); CArchive ar (& fi, CArchive: load); awen. serialize (ar); // deserialization object ar. close (); fi. close ();}