Click to return to the Component Development home page    
IPersistPropertyBag2::Loa...     IPropertyBag2 Interface     IPersistPropertyBag2 Inte...    
Web Workshop  |  Component Development

IPersistPropertyBag2::Save Method


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

Syntax

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

Parameters

pPropBag
[in] Address of the caller's IPropertyBag2 interface, through which the object can write properties. This argument cannot be NULL.
fClearDirty
[in] Flag indicating whether the object should clear its "dirty" flag when saving is complete. If this argument is nonzero, the flag should be cleared. If this argument is zero, the flag should not be changed. Zero is used when the caller wants to do a "Save Copy As" operation.
fSaveAllProperties
[in] Flag indicating whether the object should save all its properties or only those that have changed from their default values. If this argument is nonzero, all properties should be saved. If this argument is zero, only those properties that have changed from their default values should be 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 could not be saved. The object can choose to succeed (return S_OK) if all essential properties could be saved but one or more nonessential properties could not be saved.
E_POINTER The address in pPropBag is not valid (such as NULL), and therefore the object cannot initialize itself.

Remarks

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

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



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.