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



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.


Points to the stream in which the object is to be saved.

Return Values


Indicates the object was successfully saved.


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.


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


Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database