OleConvertIStorageToOLESTREAMEx function (ole2.h)

The OleConvertIStorageToOLESTREAMEx function converts the specified storage object from OLE 2 structured storage to the OLE 1 storage object model, including the presentation data. This is one of several functions included in Structured Storage to ensure compatibility between OLE1 and OLE2.

Syntax

HRESULT OleConvertIStorageToOLESTREAMEx(
  [in]  LPSTORAGE   pstg,
  [in]  CLIPFORMAT  cfFormat,
  [in]  LONG        lWidth,
  [in]  LONG        lHeight,
  [in]  DWORD       dwSize,
  [in]  LPSTGMEDIUM pmedium,
  [out] LPOLESTREAM polestm
);

Parameters

[in] pstg

Pointer to the IStorage interface on the storage object to be converted to an OLE 1 storage.

[in] cfFormat

Format of the presentation data. May be NULL, in which case the lWidth, lHeight, dwSize, and pmedium parameters are ignored.

[in] lWidth

Width of the object presentation data in HIMETRIC units.

[in] lHeight

Height of the object presentation data in HIMETRIC units.

[in] dwSize

Size of the data, in bytes, to be converted.

[in] pmedium

Pointer to the STGMEDIUM structure for the serialized data to be converted.

[out] polestm

Pointer to a stream where the persistent representation of the object is saved using the OLE 1 storage model.

Return value

This function supports the standard return value E_INVALIDARG, in addition to the following:

Remarks

The OleConvertIStorageToOLESTREAMEx function converts an OLE 2 storage object to OLE 1 format. It differs from the OleConvertIStorageToOLESTREAM function in that the OleConvertIStorageToOLESTREAMEx function also passes the presentation data to the OLE 1 storage object, whereas the OleConvertIStorageToOLESTREAM function does not.

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

The value of the tymed member of STGMEDIUM must be either TYMED_HGLOBAL or TYMED_ISTREAM; refer to the TYMED enumeration for more information. The medium is not released by the OleConvertIStorageToOLESTREAMEx function.

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

OleConvertOLESTREAMToIStorage

OleConvertOLESTREAMToIStorageEx

STGMEDIUM

TYMED