Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
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.


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

Community Additions

© 2015 Microsoft