Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This interface works in conjunction with IPropertyBagto define an individual property-based persistence mechanism.

Methods

The following tables show the methods for this interface in alphabetical order. This interface inherits the methods for the IUnknownand IPersist.

Method Description

InitNew

Informs the object that it is being initialized as a newly created object.

Load

Instructs the object to initialize itself using the properties available in the property bag, and notifies the provided error log object when errors occur.

Save

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

Remarks

A mechanism such as IPersistStreamgives an object an IStreamin which to store its binary data, while IPersistPropertyBagprovides an object with an IPropertyBaginterface through which it can save and load individual properties.

The object that implements IPropertyBagcan then save those properties in various ways, such as in name and value pairs in a text file.

Errors encountered in the process on either side are recorded in an error log through IErrorlog. This error reporting mechanism works on a per-property basis instead of on all properties at once.

IPropertyBagand IPersistPropertyBagoptimize "Save as Text" mechanisms, and therefore are recommended for ActiveX Control containers that implement a "Save as Text" mechanism.

IPropertyBagis implemented by a container, and is roughly analogous to IStream.

IPersistPropertyBagis implemented by controls, and is roughly analogous to IPersistStream.

Requirements

Header ocidl.h, ocidl.idl
Library ole32.lib, uuid.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also