Saves an object with the IPersistStream interface on it to the specified stream.
WINOLEAPI OleSaveToStream(
IPersistStream * pPStm, //Pointer to the interface on the object
// to be saved
IStream * pStm //Pointer to the destination stream to
// which the object is saved
);
This function can also return any of the error values returned by the WriteClassStm function or the IPersistStream::Save method.
This function simplifies saving an object that implements the IPersistStream interface to a stream. In this stream, the object's CLSID precedes its data. When the stream is retrieved, the CLSID permits the proper code to be associated with the data. The OleSaveToStream function does the following:
The companion helper, OleLoadFromStream, loads objects saved in this way.
Windows NT: Use version 3.1 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in ole2.h.
Import Library: Included as a resource in ole32.dll.
OleLoadFromStream, IPersistStream, IStream