IPersist

The IPersist interface is the base interface for three other persistence-related interfaces: IPersistStorage, IPersistStream, and IPersistFile. These three interfaces are offered by objects that can serialize themselves to a storage, stream, or file. That is, they can save their state for later instantiations, and they can load their saved state, thus transitioning from a passive to a running state.

Typically, the persistence interfaces are implemented by an embedded or linked object. The container application or the default object handler calls the methods in one of the persistence interfaces to have the object save or load itself. Thus, the object that offers a persistence interface can change itself to an active or running state by request of its container application or its object handler.

The IPersist interface is the base from which the other persistence interfaces are derived. Its one method returns the class identifier (CLSID) of an object that implements one of the other persistence interfaces.

When to Implement

You must implement the IPersist interface whenever you implement any one of the other persistence interfaces: IPersistStorage, IPersistStream, or IPersistFile. Typically, embedded objects implement the IPersistStorage interface; linked objects implement the IPersistFile interface; and new moniker classes implement the IPersistStream interface.

When to Use

The IPersist interface is used primarily by the default object handler to get the class identifier of an embedded object. Typically, container applications would not call the IPersist interface unless they provide object handlers for specific classes of objects.

Methods in Vtable Order

IUnknown Methods
Description
QueryInterface
Returns pointers to supported interfaces.
AddRef
Increments the reference count.
Release
Decrements the reference count.

IPersist Method
Description
GetClassID
Returns the class identifier (CLSID) for the component object.

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database