Export (0) Print
Expand All

OleLoadFromStream function

Loads an object from the stream.

Syntax


HRESULT OleLoadFromStream(
  _In_   LPSTREAM pStm,
  _In_   REFIID iidInterface,
  _Out_  LPVOID *ppvObj
);

Parameters

pStm [in]

Pointer to the IStream interface on the stream from which the object is to be loaded.

iidInterface [in]

Interface identifier (IID) the caller wants to use to communicate with the object after it is loaded.

ppvObj [out]

Address of pointer variable that receives the interface pointer requested in riid. Upon successful return, *ppvObj contains the requested interface pointer on the newly loaded object.

Return value

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

Return codeDescription
E_OUTOFMEMORY

Insufficient memory for the operation.

E_NOINTERFACE

The object does not support the specified interface.

 

This function can also return any of the error values returned by the ReadClassStm and CoCreateInstance functions, and the IPersistStream::Load method.

Remarks

This function can be used to load an object that supports the IPersistStream interface. The CLSID of the object must immediately precede the object's data in the stream, which is accomplished by the companion function OleSaveToStream (or the operations it wraps, which are described under that topic).

If the CLSID for the stream is CLSID_NULL, the ppvObj parameter is set to NULL.

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

OleSaveToStream

 

 

Community Additions

ADD
Show:
© 2014 Microsoft