Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IPersistPropertyBag2::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(
    IPropertyBag2 *pPropBag,
    BOOL fClearDirty,
    BOOL fSaveAllProperties
);

Parameters

pPropBag
[in] The address of the caller's IPropertyBag2 interface, through which the object can write properties. This argument cannot be NULL.
fClearDirty
[in] A flag indicating whether the object clears its "dirty" flag when the "Save" operation is complete. If this argument is nonzero, the flag is cleared. If this argument is zero, the flag is not changed. Zero is used when the caller performs a "Save Copy As" operation.
fSaveAllProperties
[in] A flag indicating whether the object should save all its properties, or save only those properties that have changed from their default values. If this argument is nonzero, all properties are saved. If this argument is zero, only those properties that have changed from their default values are saved.

Return Value

Returns one of the following values.

S_OK The object successfully saved the requested properties.
E_FAIL One or more essential properties cannot be saved. The object can return S_OK if all essential properties can be saved, but one or more nonessential properties 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

Show:
© 2015 Microsoft