Click to return to the Component Development home page    
IPropertyBag2::LoadObject...     IPropertyBag2::Write Meth...     IPropertyBag2 Interface    
Web Workshop  |  Component Development

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] Number of properties to read. This argument specifies the number of elements in the arrays at pPropBag, pvarValue, and phrError.
pPropBag
[in] Address of an array of PROPBAG2 structures that specify the properties being requested. The vt and pstrName members of these structures must be filled in before calling this method. 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] Address of an IErrorLog interface in which the property bag stores any errors that occur during the reads. This argument can be NULL; in that case, the caller receives no logging errors.
pvarValue
[out] Address of an array of VARIANT structures that receive the property values. The caller does not need to initialize these structures before calling Read. The Read method will fill both type and value fields in these structures before returning. 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] Address of an array of HRESULT values that will receive 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 were not successfully read. The array at phrError will contain a success or error code for each property. If the caller supplied an IErrorLog interface for pErrLog, a more descriptive error will be added.

See Also

PROPBAG2, PROPBAG2_TYPE



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.