Saves an IPersistStream object to the specified stream.
HRESULT OleSaveToStream(
IPersistStream * pPStm, //Points to the object to be saved
IStream * pStm //Points to the destination stream to which the object is saved
);
Parameters
pPStm
Points to the IPersistStorage object to be saved to the stream. Can be NULL, which has the effect of writing CLSID_NULL to the stream.
pStm
Points to the stream in which the object is to be saved.
Return Values
S_OK
Indicates the object was successfully saved.
STG_E_MEDIUMFULL
Indicates there is no space left on device to save the object.
See also the WriteClassStm function for other error return values.
See also the IPersistStream::Save method for other error return values.
Comments
This function simplifies saving an IPersistStream object to a stream. The object is saved preceded by its CLSID. The OleSaveToStream function performs the following steps:
1. Calls the IPersistStream::GetClassID method to get the object's CLSID.
2. Writes the CLSID to the stream with the WriteClassStm function.
3. Calls the IPersistStream::Save method with fClearDirty set to TRUE. Note that this clears the dirty bit in the object.
See Also
OleLoadFromStream