Click to return to the Component Development home page    
IPersistPropertyBag2::IsD...     IPersistPropertyBag2::Sav...     IPersistPropertyBag2 Inte...    
Web Workshop  |  Component Development

IPersistPropertyBag2::Load Method

Instructs the object to initialize itself using the properties available in the property bag, notifying the provided error log object when errors occur.

Syntax

HRESULT Load(
    IPropertyBag2 *pPropBag, 
    IErrorLog *pErrorLog
);

Parameters

pPropBag
[in] Address of the caller's IPropertyBag2 interface, through which the object can read properties. This argument cannot be NULL.
pErrorLog
[in] Address of the caller's IErrorLog interface, in which the object stores any errors that occur during initialization. This argument can be NULL; in that case, the caller does not receive errors.

Return Value

Returns one of the following values:

S_OK The object successfully initialized itself.
E_UNEXPECTED This member was called after IPersistPropertyBag2::InitNew had already been called. The two initialization methods are mutually exclusive.
E_POINTER The address in pPropBag is not valid (such as NULL), and therefore the object cannot initialize itself.
E_FAIL The object was unable to retrieve a property that is necessary for the object's successful operation. The object was unable to initialize itself completely.

Remarks

All property storage must take place within the Load function call, as the object cannot keep the IPropertyBag2 interface pointer passed in pPropBag.

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



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.