OleLoadFromStream function

Loads an object from the stream.

Syntax

OLESTATUS OleLoadFromStream(
  LPOLESTREAM ,
  LPCSTR      ,
  LPOLECLIENT ,
  LHCLIENTDOC ,
  LPCSTR      ,
  LPOLEOBJECT *
);

Parameters

arg1

arg2

arg3

arg4

arg5

arg6

Return Value

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

Return code Description
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

Important  

Security Note: Calling this method with untrusted data is a security risk. Call this method only with trusted data. For more information, see Untrusted Data Security Risks.

 
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

   
Windows version Windows 2000 Professional [desktop apps only] Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ole.h (include Ole2.h)
Library Ole32.lib
DLL Ole32.dll

See Also

OleSaveToStream