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 provides an object with a property bag in which the object can persistently save its properties.

Methods

The following table shows the methods for this interface in alphabetical order. Like all COM interfaces, this interface inherits the methods for the IUnknowninterface.

Method Description

Read

Asks the property bag to read the named property into a caller-initialized VARIANT.

Write

Asks the property bag to save the named property in a caller-initialized VARIANT.

Remarks

To read a property in IPersistPropertyBag::Load, the object calls IPropertyBag::Read.

When the object is saving properties in IPersistPropertyBag::Save, it calls IPropertyBag::Write. Each property is described with a name whose value is stored in a VARIANT. This information allows a client to save the property values as text. This is the primary reason why a client might choose to support IPersistPropertyBag.

The client records errors that occur during Readinto the supplied error log.

IPropertyBagand IPersistPropertyBagoptimize "Save as Text" mechanisms, and are therefore 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