Index   Commented   Search   About

OleSaveToStream

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

Related Links

Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
TMS Scripter Studio Pro components for Delphi/C++Builder

More Online Helps

Win32 Programmer's Reference (win32.hlp)
Win32 Multimedia Programmer's Reference (mmedia.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (sock2.hlp)
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008 Free Tect Secrets ;) greatis just4fun network just4fun