CArchive::SetStoreParams
Visual Studio 2008
Use SetStoreParams when storing a large number of CObject-derived objects in an archive.
void SetStoreParams( UINT nHashSize = 2053, UINT nBlockSize = 128 );
SetStoreParams allows you to set the hash table size and the block size of the map used to identify unique objects during the serialization process.
You must not call SetStoreParams after any objects are stored, or after MapObject or WriteObject is called.
class CMyLargeDocument : public CDocument { public: virtual void Serialize(CArchive& ar); }; void CMyLargeDocument::Serialize(CArchive& ar) { if (ar.IsStoring()) ar.SetStoreParams(); // use large defaults else ar.SetLoadParams(); if (ar.IsStoring()) { // code for storing CMyLargeDocument } else { // code for loading CMyLargeDocument } }