Share via


IPropertyBag

A version of this page is also available for

Windows Embedded CE 6.0 R3

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 IUnknown interface.

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 Read into the supplied error log.

IPropertyBag and IPersistPropertyBag optimize "Save as Text" mechanisms, and are therefore recommended for ActiveX Control containers that implement a "Save as Text" mechanism.

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

IPersistPropertyBag is 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

Reference

COM Interfaces
IPersistPropertyBag:IPersist
IPersistStream
IStream