Storage Persistence

The IPersistStorage interface supports structured storage for embedded objects. The interface includes the following methods:

Method

Description

HandsOffStorage

Instructs the object to release all storage objects that have been passed to it by its container and to enter HandsOffAfterSave or HandsOffFromNormal mode.

InitNew

Initializes a new storage object.

IsDirty

Indicates whether the object has changed since it was last saved to its current storage.

Load

Initializes an object from its existing storage.

Save

Saves an object, and any nested objects that it contains, into the specified storage object. The object enters NoScribble mode.

SaveCompleted

Notifies the object that it can revert from NoScribble or HandsOff mode, in which it must not write to its storage object, to Normal mode in which it can.


For details, refer to the  COM Programmer's Reference in the Platform SDK section of MSDN.

While hosts typically look for stream persistence preferentially, it's a good idea to implement IPersistStorage anyway, to make the designer as flexible and general as possible. A simple approach is to open a stream in the storage and save the required data.