PSGetPropertyDescription function (propsys.h)

Gets an instance of a property description interface for a property specified by a PROPERTYKEY structure.

Syntax

PSSTDAPI PSGetPropertyDescription(
  [in]  REFPROPERTYKEY propkey,
  [in]  REFIID         riid,
  [out] void           **ppv
);

Parameters

[in] propkey

Type: REFPROPERTYKEY

Reference to a PROPERTYKEY.

[in] riid

Type: REFIID

Reference to the interface ID of the requested interface.

[out] ppv

Type: void**

When this function returns, contains the interface pointer requested in riid. This is typically IPropertyDescription, IPropertyDescriptionAliasInfo, or IPropertyDescriptionSearchInfo.

Return value

Type: PSSTDAPI

Returns one of the following values.

Return code Description
S_OK
The interface was obtained.
E_INVALIDARG
The ppv parameter is NULL.
TYPE_E_ELEMENTNOTFOUND
The PROPERTYKEY does not exist in the schema subsystem cache.

Remarks

We recommend that you use the IID_PPV_ARGS macro, defined in Objbase.h, to package the riid and ppv parameters. This macro provides the correct IID based on the interface pointed to by the value in ppv, which eliminates the possibility of a coding error.

Examples

The following example, to be included as part of a larger program, demonstrates how to use PSGetPropertyDescription to get the property description for the ratings property.

IPropertyDescription *pPropDesc;

HRESULT hr = PSGetPropertyDescription(PKEY_Ratings, IID_PPV_ARGS(&pPropDesc));

if (SUCCEEDED(hr))
{
    // pPropDesc is now valid.
 
    pPropDesc->Release();
}

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

PSGetPropertyDescriptionByName

PSGetPropertySystem