Share via


IPersistPropertyBag:IPersist

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This interface works in conjunction with IPropertyBag to 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 IUnknown and 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 IPersistStream gives an object an IStream in which to store its binary data, while IPersistPropertyBag provides an object with an IPropertyBag interface through which it can save and load individual properties.

The object that implements IPropertyBag can 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.

IPropertyBag and IPersistPropertyBag optimize "Save as Text" mechanisms, and therefore are 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
IErrorlog
IPersist
IPersistStream
IPropertyBag
IStream
IUnknown