Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This method notifies the object that it can revert from NoScribble or HandsOff mode, in which it must not write to its storage object, to Normal mode, in which it can.
Syntax
HRESULT SaveCompleted( IStorage* pStgNew ); |
Parameters
- pStgNew
-
[in] IStoragepointer to the new storage object, if different from the storage object prior to saving.
This pointer can be NULL if the current storage object does not change during the save operation.
If the object is in HandsOff mode, this parameter must be non-NULL.
Return Value
The following table shows the return values for this function.
Value | Description |
---|---|
S_OK |
The object was successfully returned to Normal mode. |
E_OUTOFMEMORY |
The object remained in HandsOff mode or NoScribble mode due to a lack of memory. Typically, this error occurs when the object is not able to open the necessary streams and storage objects in pStgNew. |
E_INVALIDARG |
The pStgNewparameter is not valid. Typically, this error occurs if pStgNewis NULL when the object is in HandsOff mode. |
E_UNEXPECTED |
The object is in Normal mode, and there was no previous call to the IPersistStorage::Saveor IPersistStorage::HandsOffStoragemethods. |
Remarks
This method notifies an object that it can revert to Normal mode and can once again write to its storage object. The object exits NoScribble mode or HandsOff mode.
If the object is reverting from HandsOff mode, the pStgNewparameter must be non-NULL.
In HandsOffFromNormal mode, this parameter is the new storage object that replaces the one that was revoked by the IPersistStorage::HandsOffStoragemethod. The data in the storage object is a copy of the data from the revoked storage object.
In HandsOffAfterSave mode, the data is the same as the data that was most recently saved. It is not the same as the data in the revoked storage object.
If the object is reverting from NoScribble mode, the pStgNewparameter can be NULL or non-NULL.
If NULL, the object once again has access to its storage object.
If it is not NULL, the component object should simulate receiving a call to its IPersistStorage::HandsOffStoragemethod.
If the component object cannot simulate this call, its container must be prepared to actually call the IPersistStorage::HandsOffStoragemethod.
The IPersistStorage::SaveCompletedmethod must recursively call any nested objects that are loaded or running.
If this method returns an error code, the object is not returned to Normal mode. Thus, the container object can attempt different save strategies.
To determine whether the platform supports this interface, see Determining Supported COM APIs.
Requirements
Header | objidl.h, objidl.idl |
Library | ole32.lib, uuid.lib |
Windows Embedded CE | Windows CE 2.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |