Causes one or more properties to be read from the property bag.
HRESULT Read( ULONG cProperties, PROPBAG2 *pPropBag, IErrorLog *pErrLog, VARIANT *pvarValue, HRESULT *phrError );
- [in] The number of properties to read. This argument specifies the number of elements in the arrays at pPropBag, pvarValue, and phrError.
- [in] The address of an array of PROPBAG2 structures that specify the properties that are requested. The vt member and the pstrName member of these structures must be filled in before this method can be called. The dwHint member of these structures is optional. There must be at least cProperties elements in this array. This argument cannot be NULL.
- [in] The address of an IErrorlog interface in which the property bag stores any errors that occur during the reads. This argument can be NULL; in which case, the caller receives no logging errors.
- [out] The address of an array of VARIANT structures that receive the property values. The caller does not have to initialize these structures before calling IPropertyBag2::Read. The IPropertyBag2::Read method fills the type field and the value field in these structures before it returns. There must be at least cProperties elements in this array. The calling application is responsible for freeing any allocations that are contained in these structures. This argument cannot be NULL.
- [out] The address of an array of HRESULT values that receives the result of each property read. There must be at least cProperties elements in this array. This argument cannot be NULL.
Returns one of the following values.
S_OK All of the properties were successfully read. E_FAIL One or more of the properties was not successfully read. The array at phrError contains a success code or an error code for each property. If the caller supplies an IErrorlog interface for pErrLog, a more descriptive error is added.