IPropertyStorage::ReadMultiple method

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

Syntax


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

Parameters

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:

S_OK

Success. Some of the requested properties were retrieved.

S_FALSE

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.

STG_E_ACCESSDENIED

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.

STG_E_INSUFFICIENTMEMORY

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.

HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)

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

STG_E_INVALIDPARAMETER

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.

STG_E_INVALIDPOINTER

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

HRESULT_FROM_WIN32(ERROR_NO_UNICODE_TRANSLATION)

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.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Header

Propidl.h (include Objbase.h)

Library

Uuid.lib

DLL

Ole32.dll

IID

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

See also

EnumAll Sample
Samples
StgCreatePropSetStg Sample
WriteRead Sample
IPropertySetStorage
IPropertyStorage::WriteMultiple
IPropertyStorage::WritePropertyNames

 

 

Community Additions

ADD
Show: