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.


Call SetLoadParams when you are going to read a large number of CObject-derived objects from an archive.

void SetLoadParams( 
   UINT nGrowBy = 1024  


The minimum number of element slots to allocate if a size increase is necessary.

CArchive uses a load array to resolve references to objects stored in the archive. SetLoadParams allows you to set the size to which the load array grows.

You must not call SetLoadParams after any object is loaded, or after MapObject or ReadObject 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