PSGetPropertyValue function

Gets a property value from a property store.

Syntax


HRESULT PSGetPropertyValue(
  _In_   IPropertyStore *pps,
  _In_   IPropertyDescription *ppd,
  _Out_  PROPVARIANT *ppropvar
);

Parameters

pps [in]

Type: IPropertyStore*

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

ppd [in]

Type: IPropertyDescription*

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

ppropvar [out]

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

Minimum supported client

Windows XP with SP2, Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 with SP1 [desktop apps only]

Redistributable

Windows Desktop Search (WDS) 3.0

Header

Propsys.h

Library

Propsys.lib

DLL

Propsys.dll (version 6.0 or later)

See also

PSSetPropertyValue

 

 

Community Additions

ADD
Show:
© 2014 Microsoft