OleConvertOLESTREAMToIStorageEx function (ole2.h)

The OleConvertOLESTREAMToIStorageEx function converts the specified object from the OLE 1 storage model to an OLE 2 structured storage object including presentation data. This is one of several compatibility functions.

Syntax

HRESULT OleConvertOLESTREAMToIStorageEx(
  [in]  LPOLESTREAM polestm,
  [out] LPSTORAGE   pstg,
  [out] CLIPFORMAT  *pcfFormat,
  [out] LONG        *plwWidth,
  [out] LONG        *plHeight,
  [out] DWORD       *pdwSize,
  [out] LPSTGMEDIUM pmedium
);

Parameters

[in] polestm

Pointer to the stream that contains the persistent representation of the object in the OLE 1 storage format.

[out] pstg

Pointer to the OLE 2 structured storage object.

[out] pcfFormat

Pointer to where the format of the presentation data is returned. May be NULL, indicating the absence of presentation data.

[out] plwWidth

Pointer to where the width value (in HIMETRIC) of the presentation data is returned.

[out] plHeight

Pointer to where the height value (in HIMETRIC) of the presentation data is returned.

[out] pdwSize

Pointer to where the size in bytes of the converted data is returned.

[out] pmedium

Pointer to where the STGMEDIUM structure for the converted serialized data is returned.

Return value

This function returns HRESULT.

Remarks

This function converts an OLE 1 object to an OLE 2 structured storage object. You can use this function to update OLE 1 objects to OLE 2 objects when a new version of the object application supports OLE 2.

This function differs from the OleConvertOLESTREAMToIStorage function in that the presentation data read from the OLESTREAM structure is passed out and the newly created OLE 2 storage object does not contain a presentation stream.

Since this function can specify which presentation data to convert, it can be used by applications that do not use OLE's default caching resources but do use the conversion resources.

The tymed member of STGMEDIUM can only be TYMED_NULL or TYMED_ISTREAM. If it is TYMED_NULL, the data will be returned in a global handle through the hGlobal member of STGMEDIUM, otherwise data will be written into the pstm member of this structure.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ole2.h
Library Ole32.lib
DLL Ole32.dll

See also

CoIsOle1Class

OleConvertIStorageToOLESTREAM

OleConvertIStorageToOLESTREAMEx

OleConvertOLESTREAMToIStorage

STGMEDIUM

TYMED