OleConvertIStorageToOLESTREAM

Converts the specified storage object from OLE 2 structured storage to the OLE 1 storage model but does not include the presentation data. This is one of several compatibility functions.

WINOLEAPI OleConvertIStorageToOLESTREAM(
  IStorage * pStg,         //Pointer to the OLE 2 storage object to 
                           // be converted
  LPOLESTREAM lpolestream  //Pointer to the stream where the OLE1 
                           // storage is written
);
 

Parameters

pStg
[in] Pointer to the IStorage interface on the storage object to be converted to an OLE 1 storage.
lpolestream
[out] Pointer to an OLE 1 stream structure where the persistent representation of the object is saved using the OLE 1 storage model.

Return Values

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

S_OK
The storage object was successfully converted and the OLESTREAM structure contains the persistent representation of an OLE 1 object.
CONVERT10_E_STG_NO_STD_STREAM
Object cannot be converted because its storage is missing a stream.
CONVERT10_S_NO_PRESENTATION
The specified storage object contains a Paintbrush object in DIB format and there is no presentation data in the OLESTREAM.

Remarks

This function converts an OLE 2 storage object to OLE 1 format. The OLESTREAM code implemented for OLE 1 must be available.

On entry, the stream pointed to by lpolestm should be created and positioned just as it would be for an OleSaveToStream call. On exit, the stream contains the persistent representation of the object using OLE 1 storage.

Note  Paintbrush objects are dealt with differently from other objects because their native data is in DIB format. When Paintbrush objects are converted using OleConvertIStorageToOLESTREAM, no presentation data is added to the OLESTREAM. To include presentation data, use the OleConvertIStorageToOLESTREAMEx function instead.

QuickInfo

  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.

See Also

CoIsOle1Class, OleConvertIStorageToOLESTREAMEx, OleConvertOLESTREAMToIStorage, OleConvertOLESTREAMToIStorageEx