IPropertyStorage::ReadMultiple method

The ReadMultiple method reads specified properties from the current property set.


HRESULT ReadMultiple(
  [in]  ULONG          cpspec,
  [in]  const PROPSPEC rgpspec[],
  [out] PROPVARIANT    rgpropvar[1]


cpspec [in]

The numeric count of properties to be specified in the rgpspec array. The value of this parameter can be set to zero; however, that defeats the purpose of the method as no properties are thereby read, regardless of the values set in rgpspec.

rgpspec [in]

An array of PROPSPEC structures specifies which properties are read. Properties can be specified either by a property ID or by an optional string name. It is not necessary to specify properties in any particular order in the array. The array can contain duplicate properties, resulting in duplicate property values on return for simple properties. Nonsimple properties should return access denied on an attempt to open them a second time. The array can contain a mixture of property IDs and string IDs.

rgpropvar [out]

Caller-allocated array of a PROPVARIANT structure that, on return, contains the values of the properties specified by the corresponding elements in the rgpspec array. The array must be at least large enough to hold values of the cpspec parameter of the PROPVARIANT structure. The cpspec parameter specifies the number of properties set in the array. The caller is not required to initialize these PROPVARIANT structure values in any specific order. However, the implementation must fill all members correctly on return. If there is no other appropriate value, the implementation must set the vt member of each PROPVARIANT structure to VT_EMPTY.

Return value

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


Success. Some of the requested properties were retrieved.


All the property names or IDs had valid syntax, but none of them exist in this property set. Accordingly, no properties were retrieved, and each PROPVARIANT structure is set to VT_EMPTY.


The requested access to the property set has been denied, or, when one or more of the properties is a stream or storage object, access to that substorage or substream has been denied. The storage or stream may already be open. No properties were retrieved.


Insufficient memory exists to perform this operation. No properties were retrieved. For computers running on Windows NT 4.0 and earlier, the size limit is 256 KB. For computers running on Windows 2000, Windows XP, and Windows Server 2003, the limit is 1 MB for OLE property sets.


One of the properties cannot be read because the property type was not supported by this IPropertyStorage implementation.


At least one of the parameters is invalid; for example, when one of the PROPSPEC structures contains an illegal value of the ulKind member. If the ulKind member is set to a string name instead of a property set value, some properties may not be retrieved.


At least one of the pointers passed is invalid. No properties were retrieved.


There was a failed attempt to translate a Unicode string to or from ANSI.

This function can also return any file system errors or Win32 errors wrapped in an HRESULT data type. For more information, see Error Handling Strategies.

For more information, see Property Storage Considerations.


Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]


Propidl.h (include Objbase.h)






IID_IPropertyStorage is defined as 00000138-0000-0000-C000-000000000046

See also

EnumAll Sample
StgCreatePropSetStg Sample
WriteRead Sample