IPersistPropertyBag::Load
Called by the container to load the control's properties.
HRESULT Load(
IPropertyBag* pPropBag, //Pointer to caller's property bag
IErrorLog* pErrorLog //Pointer to error log
);
Parameters
-
pPropBag
-
[in] Pointer to the caller's IPropertyBag interface bag that the control uses to read its properties. Cannot be NULL.
-
pErrorLog
-
[in] Pointer to the caller's IErrorLog interface in which the object stores any errors that occur during initialization. Can be NULL in which case the caller is not interested in errors.
Return Values
-
S_OK
-
The object successfully initialized itself.
-
E_UNEXPECTED
-
This method was called after IPersistPropertyBag::InitNew has already been called. They two initialization methods are mutually exclusive.
-
E_OUTOFMEMORY
-
The properties were not loaded due to a lack of memory.
-
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 critical property that is necessary for the object's successful operation. The object was therefore unable to initialize itself completely.
Remarks
This method instructs the object to initialize itself using the properties available in the property bag, notifying the provided error log object when errors occur. All property storage must take place within this method call as the object cannot hold the IPropertyBag pointer.
E_NOTIMPL is not a valid return code as any object implementing this interface must support the entire functionality of the interface.
See Also
IPersistPropertyBag::InitNew