Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

IPropertyBag2::Read Method

Causes one or more properties to be read from the property bag.

Syntax


HRESULT Read(
    ULONG cProperties,
    PROPBAG2 *pPropBag,
    IErrorLog *pErrLog,
    VARIANT *pvarValue,
    HRESULT *phrError
);

Parameters

cProperties
[in] The number of properties to read. This argument specifies the number of elements in the arrays at pPropBag, pvarValue, and phrError.
pPropBag
[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.
pErrLog
[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.
pvarValue
[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.
phrError
[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.

Return Value

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.

See Also

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.