IPersistPropertyBagImpl Class

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

For the latest documentation on Visual Studio 2017, see IPersistPropertyBagImpl Class on docs.microsoft.com. This class implements IUnknown and allows an object to save its properties to a client-supplied property bag.

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 IPersistPropertyBagImpl : public IPersistPropertyBag

Parameters

T
Your class, derived from IPersistPropertyBagImpl.

Public Methods

NameDescription
IPersistPropertyBagImpl::GetClassIDRetrieves the object's CLSID.
IPersistPropertyBagImpl::InitNewInitializes a newly created object. The ATL implementation returns S_OK.
IPersistPropertyBagImpl::LoadLoads the object's properties from a client-supplied property bag.
IPersistPropertyBagImpl::SaveSaves the object's properties into a client-supplied property bag.

The IPersistPropertyBag interface allows an object to save its properties to a client-supplied property bag. Class IPersistPropertyBagImpl provides a default implementation of this interface and implements IUnknown by sending information to the dump device in debug builds.

IPersistPropertyBag works in conjunction with IPropertyBag and IErrorLog. These latter two interfaces must be implemented by the client. Through IPropertyBag, the client saves and loads the object's individual properties. Through IErrorLog, both the object and the client can report any errors encountered.

Related Articles ATL Tutorial, Creating an ATL Project

IPersistPropertyBag

IPersistPropertyBagImpl

Header: atlcom.h

Retrieves the object's CLSID.

STDMETHOD(GetClassID)(CLSID* pClassID);

Remarks

See IPersist::GetClassID in the Windows SDK.

Initializes a newly created object.

STDMETHOD(InitNew)();

Return Value

Returns S_OK.

Remarks

See IPersistPropertyBag::InitNew in the Windows SDK.

Loads the object's properties from a client-supplied property bag.

STDMETHOD(Load)(LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog);

Remarks

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

See IPersistPropertyBag::Load in the Windows SDK.

Saves the object's properties into a client-supplied property bag.

STDMETHOD(Save)(
    LPPROPERTYBAG pPropBag,
    BOOL fClearDirty,
    BOOL fSaveAllProperties);

Remarks

ATL uses the object's property map to store this information. By default, this method saves all properties, regardless of the value of fSaveAllProperties.

See IPersistPropertyBag::Save in the Windows SDK.

BEGIN_PROP_MAP
Class Overview

Show: