PSGetPropertyValue function (propsys.h)

Gets a property value from a property store.

Syntax

PSSTDAPI PSGetPropertyValue(
  [in]  IPropertyStore       *pps,
  [in]  IPropertyDescription *ppd,
  [out] PROPVARIANT          *ppropvar
);

Parameters

[in] pps

Type: IPropertyStore*

Pointer to an instance of the IPropertyStore interface, which represents the property store from which to get the value.

[in] ppd

Type: IPropertyDescription*

Pointer to an instance of the IPropertyDescription interface, which represents the property in the property store.

[out] ppropvar

Type: PROPVARIANT*

Pointer to an uninitialized PROPVARIANT structure. When this function returns, points to the requested property value.

Return value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

This helper function is used to read a property value from a store. If the calling code already has a PROPERTYKEY structure, it might be simpler to call IPropertyStore::GetValue directly.

Examples

The following example, to be included as part of a larger program, demonstrates how to use PSGetPropertyValue.

// IPropertyDescription *pPropDesc;
// IPropertyStore *pStore;
// Assume the variables pPropDesc and pStore are initialized and valid.
PROPVARIANT propvar;

HRESULT hr = PSGetPropertyValue(pStore, pPropDesc, &propvar);

if (SUCCEEDED(hr))
{
    // propvar is valid.
 
    PropVariantClear(&propvar);
}

Requirements

Requirement Value
Minimum supported client Windows XP with SP2, Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 with SP1 [desktop apps only]
Target Platform Windows
Header propsys.h
Library Propsys.lib
DLL Propsys.dll (version 6.0 or later)
Redistributable Windows Desktop Search (WDS) 3.0

See also

PSSetPropertyValue