Export (0) Print
Expand All

IPersistPropertyBag::Save Method

Instructs the object to save its properties to the given property bag, and optionally, to clear the object's dirty flag.

Syntax


HRESULT Save(
    IPropertyBag *pPropBag,
    BOOL fClearDirty,
    BOOL fSaveAllProperties
);

Parameters

pPropBag
[in] The address of the caller's property bag, through which the object can write properties. This cannot be NULL.
fClearDirty
[in] A flag indicating whether the object should clear its dirty flag when the "Save" operation is complete. TRUE means clear the flag, and FALSE means leave the flag unaffected. FALSE is used when the caller performs a "Save Copy As" operation.
fSaveAllProperties
[in] A flag indicating whether the object should save all its properties (TRUE), or save only those properties that have changed from the default value (FALSE).

Return Value

Returns one of the following values.

S_OK The object successfully saved the requested properties.
E_FAIL There was a problem saving one of the properties. The object can choose to fail only if a necessary property cannot be saved.
E_POINTER The address in pPropBag is not valid (such as NULL), and the object cannot initialize itself.

Remarks

The caller can request that the object save all properties, or save only those properties that have changed.

E_NOTIMPL is not a valid return code, because any object that implements this interface must support the entire functionality of the interface.

Community Additions

ADD
Show:
© 2015 Microsoft