Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic


Use SetStoreParams when storing a large number of CObject-derived objects in an archive.

void SetStoreParams( 
   UINT nHashSize = 2053, 
   UINT nBlockSize = 128  

The size of the hash table for interface pointer maps. Should be a prime number.


Specifies the memory-allocation granularity for extending the parameters. Should be a power of 2 for the best performance.

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
   virtual void Serialize(CArchive& ar);
void CMyLargeDocument::Serialize(CArchive& ar)
   if (ar.IsStoring())
      ar.SetStoreParams();  // use large defaults

   if (ar.IsStoring())
      // code for storing CMyLargeDocument
      // code for loading CMyLargeDocument

Header: afx.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.