Export (0) Print
Expand All

OleSaveToStream function

Saves an object with the IPersistStream interface on it to the specified stream.

Syntax


HRESULT OleSaveToStream(
  _In_  LPPERSISTSTREAM pPStm,
  _In_  LPSTREAM pStm
);

Parameters

pPStm [in]

Pointer to the IPersistStream interface on the object to be saved to the stream. The pPStm parameter cannot be NULL.

pStm [in]

Pointer to the IStream interface on the stream in which the object is to be saved.

Return value

This function returns S_OK on success. Other possible values include the following.

Return codeDescription
STGMEDIUM_E_FULL

The object could not be saved due to lack of disk space.

OLE_E_BLANK

The pPStm parameter is NULL.

 

This function can also return any of the error values returned by the WriteClassStm function or the IPersistStream::Save method.

Remarks

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.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Ole2.h

Library

Ole32.lib

DLL

Ole32.dll

See also

OleLoadFromStream
IPersistStream
IStream

 

 

Community Additions

ADD
Show:
© 2014 Microsoft