Save

HRESULT Save(
IStream *pStream, 
const void *pBuffer, 
long cbBuffer);
HRESULT Save(
IPropertyBag *pPropertyBag, 
const void *pBuffer, 
long cbBuffer, 
BOOL fWriteDefaults = FALSE);

Parameters

pStream

Pointer to IStream to which to save properties.

pBuffer

User-defined buffer. This data is not modified.

cbBuffer

Size of the user buffer. Buffer overflow is checked using this buffer size.

pPropertyBag

Pointer to IPropertyBag to which to save properties.

fWriteDefault

TRUE to persist all properties, FALSE to persist only those that are not the default.

Return Code

S_OK if succeeded, otherwise error code.

Comments (Save IStream)

Save properties to the stream.

Use EnablePropSave to prevent a property from being saved. Otherwise, only properties without default values are saved. Use IsPropSaved to test whether the property was actually saved.

Comments (Save IPropertyBag)

Saves properties to the PropertyBag.

Use EnablePropSave to prevent a property from being saved. This supersedes fWriteDefaults. Use IsPropSaved to test whether the property was actually saved.