IPropertyBag::ReadIPropertyBag::Read*
*Contents  *Index  *Topic Contents
*Previous Topic: The IPropertyBag Interface
*Next Topic: IPropertyBag::Write

IPropertyBag::Read

HRESULT Read([in] LPCOLESTR pszPropName, 
		[in,out] VARIANT *pVar, 
		[in,out] IErrorLog *pErrorLog);

Asks the property bag to read the property named with pszPropName into the caller-initialized VARIANT in pVar. Errors that occur are logged in the error log pointed to by pErrorLog. When pVar->vt specifies another object pointer (VT_UNKNOWN), the property bag is responsible for creating and initializing the object described by pszPropName. See IPropertyBag::Write for more information.

pszPropName
[in] The name of the property to read. Cannot be NULL.
pVar
[in, out] The address of the caller-initialized VARIANT that is to receive the property value on output. The function must set both type and value fields in the VARIANT before returning. If the caller initialized the pVar->vt field on entry, the property bag should attempt to coerce the value it knows into this type. If the caller sets pVar->vt to VT_EMPTY, the property bag can use whatever type is convenient.
pErrorLog
[in] Address of the caller's error log in which the property bag stores any errors that occur during reads. Can be NULL; in that case, the caller is not interested in errors.

E_NOTIMPL is not a valid return code because any object implementing this interface must support the entire functionality of the interface.


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.