CArchive::Flush
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

CArchive::Flush

Forces any data remaining in the archive buffer to be written to the file.

void Flush( );

Remarks

The member function Flush ensures that all data is transferred from the archive to the file. You must call CFile::Close to complete the transfer from the file to the storage medium.

Example

CFile myFile("myfile.dat", CFile::modeCreate | CFile::modeWrite);
CArchive ar(&myFile, CArchive::store);

// Write a string to the archive.
ar.WriteString( "My string." );

// Flush all of the data to the file.
ar.Flush();

See Also

CArchive Overview | Class Members | Hierarchy Chart | CArchive::Close | CFile::Flush | CFile::Close

Show:
© 2016 Microsoft