IPersistStreamInitImpl 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 IPersistStreamInitImpl Class.

This class implements IUnknown and provides a default implementation of the IPersistStreamInit 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 IPersistStreamInitImpl 
   : public IPersistStreamInit

Parameters

T
Your class, derived from IPersistStreamInitImpl.

Public Methods

NameDescription
IPersistStreamInitImpl::GetClassIDRetrieves the object's CLSID.
IPersistStreamInitImpl::GetSizeMaxRetrieves the size of the stream needed to save the object's data. The ATL implementation returns E_NOTIMPL.
IPersistStreamInitImpl::InitNewInitializes a newly created object.
IPersistStreamInitImpl::IsDirtyChecks whether the object's data has changed since it was last saved.
IPersistStreamInitImpl::LoadLoads the object's properties from the specified stream.
IPersistStreamInitImpl::SaveSaves the object's properties to the specified stream.

The IPersistStreamInit interface allows a client to request that your object loads and saves its persistent data to a single stream. Class IPersistStreamInitImpl provides a default implementation of this interface and implements IUnknown by sending information to the dump device in debug builds.

Related Articles ATL Tutorial, Creating an ATL Project

IPersistStreamInit

IPersistStreamInitImpl

Header: atlcom.h

Retrieves the object's CLSID.

STDMETHOD(GetClassID)(CLSID* pClassID);

Remarks

See IPersist::GetClassID in the Windows SDK.

Retrieves the size of the stream needed to save the object's data.

STDMETHOD(GetSizeMax)(ULARGE_INTEGER FAR* pcbSize);

Return Value

Returns E_NOTIMPL.

Remarks

See IPersistStreamInit::GetSizeMax in the Windows SDK.

Initializes a newly created object.

STDMETHOD(InitNew)();

Remarks

See IPersistStreamInit::InitNew in the Windows SDK.

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

STDMETHOD(IsDirty)();

Remarks

See IPersistStreamInit::IsDirty in the Windows SDK.

Loads the object's properties from the specified stream.

STDMETHOD(Load)(LPSTREAM pStm);

Remarks

ATL uses the object's property map to retrieve this information.

See IPersistStreamInit::Load in the Windows SDK.

Saves the object's properties to the specified stream.

STDMETHOD(Save)(LPSTREAM pStm, BOOL fClearDirty);

Remarks

ATL uses the object's property map to store this information.

See IPersistStreamInit::Save in the Windows SDK.

Storages and Streams
Class Overview

Show: