OleLoadFromStream

Loads an object from the stream.

WINOLEAPI OleLoadFromStream(
IStream *pStm,
REFIID iidInterface,
void **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 once 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 Values

This function supports the standard return value E_OUTOFMEMORY, as well as the following:

  • S_OK
    The object was successfully loaded.
  • E_NOINTERFACE
    The specified interface is not supported.

This function can also return any of the error values returned by the ReadClassStm and CoCreateInstance functions, and the IPersistStorage::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

Runs On Versions Defined in Include Link to
Windows CE OS 3.0 and later Ole2.h   Ole232.lib

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

OleSaveToStream

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.