CArchive::Flush

强制保持在存档缓冲区的任何数据都将写入文件。

void Flush( );

备注

成员函数 Flush 确保所有数据从存档传输到文件。 必须调用 CFile::Close 完成调用从文件添加到存储媒介。

示例

CFile myFile(_T("CArchive__test__file.txt"), 
   CFile::modeCreate | CFile::modeWrite);
CArchive ar(&myFile, CArchive::store);

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

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

要求

Header: afx.h

请参见

参考

CArchive选件类

层次结构图

CArchive::Close

CFile::Flush

CFile::Close