IPerPropertyBrowsing::GetPredefinedValue

Returns a VARIANT containing the value of the property specified by dispID. This property is associated with a predefined string name as returned from IPerPropertyBrowsing::GetPredefinedStrings. The predefined string is identified by a token returned from GetPredefinedStrings.

HRESULT GetPredefinedValue(
  DISPID dispID ,  //Dispatch identifier for property
  DWORD dwCookie , //Token returned
  VARIANT *pVarOut //Receives a pointer to a VARIANT value for the 
                   //property
);
 

Parameters

dispID
[in] Dispatch identifier of the property for which a predefined value is requested.
dwCookie
[in] Token identifying which value to return. The token was previously returned in the pcaCookiesOut array filled by IPerPropertyBrowsing::GetPredefinedStrings.
pVarOut
[out] Pointer to the VARIANT value for the property.

Return Values

This method supports the standard return values E_INVALIDARG,

E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following:

S_OK
The value was returned successfully.
E_NOTIMPL
This object does not support predefined strings or predefined values.
E_POINTER
The address in pVarOut is not valid. For example, it may be NULL.

Remarks

Notes to Callers

The caller is responsible for freeing any allocations contained in the VARIANT. Unless the vt field of VARIANT is VT_VARIANT, the caller can free memory using a single call to VariantClear. Otherwise, the caller must recursively free the contained VARIANTs before freeing the outer VARIANT.

Notes to Implementers

Support for predefined names and values is not required. If your object does not support these names, return E_NOTIMPL from this method. If this method is not implemented, IPerPropertyBrowsing::GetPredefinedStrings must not be implemented either.

This method allocates any memory needed inside the VARIANT.

QuickInfo

  Windows NT: Use version 4.0 or later.
  Windows: Use Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in ocidl.h.

See Also

IPerPropertyBrowsing::GetPredefinedStrings