# IPropertyStorage::ReadPropertyNames

Retrieves any existing string names for the specified property identifiers.

HRESULT ReadPropertyNames(

ULONG cpropid, | //Number of elements in rgpropid
PROPID const rgpropid[], | //Property identifiers for which names are to be retrieved.
LPWSTR rglpwstrName[] | //Array of returned string names
); |

Parameters

cpropid
  [in] Number of elements on input of the array rgpropid. May legally be zero, though this is a no-op, reading no property names.
rgpropid[]
  [in] Array of property identifiers for which names are to be retrieved.
rglpwstrName[]
  [in, out] Caller-allocated array of size cpropid of LPWSTRs. On return, the implementation fills in this array. A given entry contains either the corresponding string name of a property identifier or NULL if the property identifier has no string name.

  Each LPWSTR member of the array should be freed using CoTaskMemFree.

Return Values

This method supports the standard return value E_UNEXPECTED, as well as the following:

S_OK
  One or more string names were retrieved and all members of rglpwstrName are valid (either NULL or a valid LPWSTR).
S_FALSE
  No string names were retrieved because none of the requested property identifiers have string names presently associated with them in this property storage object (this result does not address whether the given property identifiers presently exist in the set).
STG_E_INVALIDHEADER
  The property name dictionary was not found.
STG_E_READFAULT
  Error reading the storage.
STG_E_ACCESSDENIED
  The requested access to the property storage object has been denied. No string names were retrieved.
STG_E_INSUFFICIENTMEMORY
  There is not sufficient memory to perform this operation. No string names were retrieved.
STG_E_INVALIDPARAMETER
  A parameter is invalid. No string names were retrieved.
HRESULT_FROM_WIN32(ERROR_NO_UNICODE_TRANSLATION)
  There was a failed attempt to translate a Unicode string to or from Ansi.

Remarks

For each property identifier in the list of property identifiers supplied in the rgpropid array, IPropertyStorage::ReadPropertyNames retrieves the corresponding string name, if there is one. String names are created either by specifying the names in calls to IPropertyStorage::WriteMultiple when you are creating the property, or through a call to IPropertyStorage::WritePropertyNames. In any case, the string name is optional; all properties must have a property identifier.

String names mapped to property identifiers must be unique within the set.

See Also

IPropertyStorage::WritePropertyNames, IPropertyStorage::WriteMultiple