IPersistStorageImpl Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at IPersistStorageImpl Class.

This class implements the IPersistStorage interface.

System_CAPS_ICON_important.jpg Important

This class and its members cannot be used in applications that execute in the Windows Runtime.

template <class T>  
class ATL_NO_VTABLE IPersistStorageImpl : public IPersistStorage

Parameters

T
Your class, derived from IPersistStorageImpl.

Public Methods

NameDescription
IPersistStorageImpl::GetClassIDRetrieves the object's CLSID.
IPersistStorageImpl::HandsOffStorageInstructs the object to release all storage objects and enter HandsOff mode. The ATL implementation returns S_OK.
IPersistStorageImpl::InitNewInitializes a new storage.
IPersistStorageImpl::IsDirtyChecks whether the object's data has changed since it was last saved.
IPersistStorageImpl::LoadLoads the object's properties from the specified storage.
IPersistStorageImpl::SaveSaves the object's properties to the specified storage.
IPersistStorageImpl::SaveCompletedNotifies an object that it can return to Normal mode to write to its storage object. The ATL implementation returns S_OK.

IPersistStorageImpl implements the IPersistStorage interface, which allows a client to request that your object load and save its persistent data using a storage.

The implementation of this class requires class T to make an implementation of the IPersistStreamInit interface available via QueryInterface. Typically this means that class T should derive from IPersistStreamInitImpl, provide an entry for IPersistStreamInit in the COM map, and use a property map to describe the class's persistent data.

Related Articles ATL Tutorial, Creating an ATL Project

IPersistStorage

IPersistStorageImpl

Header: atlcom.h

Retrieves the object's CLSID.

STDMETHOD(GetClassID)(CLSID* pClassID);

Remarks

See IPersist::GetClassID in the Windows SDK.

Instructs the object to release all storage objects and enter HandsOff mode.

STDMETHOD(HandsOffStorage)(void);

Return Value

Returns S_OK.

Remarks

See IPersistStorage::HandsOffStorage in the Windows SDK.

Initializes a new storage.

STDMETHOD(InitNew)(IStorage*);

Remarks

The ATL implementation delegates to the IPersistStreamInit interface.

See IPersistStorage:InitNew in the Windows SDK.

Checks whether the object's data has changed since it was last saved.

STDMETHOD(IsDirty)(void);

Remarks

The ATL implementation delegates to the IPersistStreamInit interface.

See IPersistStorage:IsDirty in the Windows SDK.

Loads the object's properties from the specified storage.

STDMETHOD(Load)(IStorage* pStorage);

Remarks

The ATL implementation delegates to the IPersistStreamInit interface. Load uses a stream named "Contents" to retrieve the object's data. The Save method originally creates this stream.

See IPersistStorage:Load in the Windows SDK.

Saves the object's properties to the specified storage.

STDMETHOD(Save)(IStorage* pStorage, BOOL fSameAsLoad);

Remarks

The ATL implementation delegates to the IPersistStreamInit interface. When Save is first called, it creates a stream named "Contents" on the specified storage. This stream is then used in later calls to Save and in calls to Load.

See IPersistStorage:Save in the Windows SDK.

Notifies an object that it can return to Normal mode to write to its storage object.

STDMETHOD(SaveCompleted)(IStorage*);

Return Value

Returns S_OK.

Remarks

See IPersistStorage:SaveCompleted in the Windows SDK.

Storages and Streams
IPersistStreamInitImpl Class
IPersistPropertyBagImpl Class
Class Overview

Show: