继续问 关于CArchive()构造函数第二个参数 bNoFlushOnDelete属性
我查了下MSDN,以下是相关描述:
CArchive::bNoFlushOnDelete
Prevents the archive from automatically calling Flush when the archive destructor is called. If you set this flag, you are responsible for explicitly calling Close before the destructor is called. If you do not, your data will be corrupted.
这个属性设置的目的是 在对象析构之前,自己显式调用CArchive::Close()函数;
但是Close()函数的作用是:
Flushes any data remaining in the buffer, closes the archive, and disconnects the archive from the file.
这里也是需要清除缓冲的。
问题是:什么情况下要设置这个属性,为什么要设置这个属性?