Complete this project - Serialization

2025-11-10

Written by: xiaobin

The project requires the following articles:

Opening a List

    CFile fleConns;
    CFileFind fndFile;
    CString strFilename = _T("conns.str");

    // Look for the conns.str file
    BOOL exists = fndFile.FindFile(strFilename);

    if( exists == TRUE )
    {
        // If the file exists, open it and fill the controls with it
        fleConns.Open(strFilename, CFile::modeRead);
        // Create a CArchive object to receive the collection
        CArchive arc(&fleConns, CArchive::load);
        // Pass the CArchive object to the Serialize() function of this application
        Serialize(arc);

        // Close the archive
        arc.Close();
        // Close the file stream
        fleConns.Close();

        // Behave as if the user had just clicked the "Get Data" button
        OnBnClickedButton1();
    }

This is an addition based on the CollSerialDemo.zip.