IPersistPropertyBagImpl 类

此类实现 IUnknown 并允许对象将其属性保存到客户端提供的属性包。

重要

无法在 Windows 运行时中执行的应用程序中使用此类及其成员。

语法

template <class T>
class ATL_NO_VTABLE IPersistPropertyBagImpl : public IPersistPropertyBag

参数

T
你的类,派生自 IPersistPropertyBagImpl

成员

公共方法

名称 描述
IPersistPropertyBagImpl::GetClassID 检索对象的 CLSID。
IPersistPropertyBagImpl::InitNew 初始化新建的 对象。 ATL 实现返回 S_OK。
IPersistPropertyBagImpl::Load 从客户端提供的属性包加载对象的属性。
IPersistPropertyBagImpl::Save 将对象的属性加载到客户端提供的属性包中。

注解

IPersistPropertyBag 接口允许对象将其属性保存到客户端提供的属性包。 类 IPersistPropertyBagImpl 提供此接口的默认实现,并通过在调试版本中将信息发送到转储设备来实现 IUnknown

IPersistPropertyBagIPropertyBagIErrorLog 结合使用。 后两个接口必须由客户端实现。 通过 IPropertyBag,客户端保存并加载对象的单个属性。 通过 IErrorLog,对象和客户端都可以报告遇到的任何错误。

相关文章ATL 教程创建 ATL 项目

继承层次结构

IPersistPropertyBag

IPersistPropertyBagImpl

要求

标头:atlcom.h

IPersistPropertyBagImpl::GetClassID

检索对象的 CLSID。

STDMETHOD(GetClassID)(CLSID* pClassID);

备注

请参阅 Windows SDK 中的 IPersist::GetClassID

IPersistPropertyBagImpl::InitNew

初始化新建的 对象。

STDMETHOD(InitNew)();

返回值

返回 S_OK。

备注

请参阅 Windows SDK 中的 IPersistPropertyBag::InitNew

IPersistPropertyBagImpl::Load

从客户端提供的属性包加载对象的属性。

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

注解

ATL 使用对象的属性映射来检索此信息。

请参阅 Windows SDK 中的 IPersistPropertyBag::Load

IPersistPropertyBagImpl::Save

将对象的属性加载到客户端提供的属性包中。

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

注解

ATL 使用对象的属性映射来存储此信息。 默认情况下,无论 fSaveAllProperties 的值如何,此方法都会保存所有属性。

请参阅 Windows SDK 中的 IPersistPropertyBag::Save

另请参阅

BEGIN_PROP_MAP
类概述