共用方式為


IPropertyValueStatics::CreateInspectable 方法 (windows.foundation.h)

建立新的 IPropertyValue 物件,其中包含指定的 IInspectable 物件。

語法

HRESULT CreateInspectable(
  [in]          IInspectable *value,
  [out, retval] IInspectable **propertyValue
);

參數

[in] value

類型:IInspectable*

要儲存的物件。

[out, retval] propertyValue

類型:IInspectable**

新 物件的指標,其中包含

傳回值

類型:HRESULT

這個方法可以傳回其中一個值。

傳回碼 描述
S_OK
已成功建立屬性值。
E_POINTER
NULL
E_OUTOFMEMORY
無法建立 IPropertyValue 物件。

言論

使用 CreateInspectable 方法,將值儲存在 IPropertyValue 物件中。 您可以將 IPropertyValue 物件新增至屬性存放區。 使用 GetInspectable 方法,從 IPropertyValue 物件擷取值。

要求

要求 價值
最低支援的用戶端 Windows 8
支援的最低伺服器 Windows Server 2012
目標平臺 窗戶
標頭 windows.foundation.h

另請參閱

IPropertyValue::GetInspectable

IPropertyValueStatics