OleConvertIStorageToOLESTREAMEx function

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


WINOLEAPI OleConvertIStorageToOLESTREAMEx(
  _In_  IStorage    *pStg,
  _In_  CLIPFORMAT  cfFormat,
  _In_  LONG        lWidth,
  _In_  LONG        lHeight,
  _In_  DWORD       dwSize,
  _In_  STGMEDIUM   pmedium,
  _Out_ LPOLESTREAM lpolestm
);

Parameters

pStg [in]

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

cfFormat [in]

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

lWidth [in]

Width of the object presentation data in HIMETRIC units.

lHeight [in]

Height of the object presentation data in HIMETRIC units.

dwSize [in]

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

pmedium [in]

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

lpolestm [out]

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:

S_OK

The conversion was completed successfully.

DV_E_STGMEDIUM

The hGlobal member of STGMEDIUM is NULL.

DV_E_TYMED

The tymed member of the STGMEDIUM structure is not TYMED_HGLOBAL or TYMED_ISTREAM.

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

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Ole2.h

Library

Ole32.lib

DLL

Ole32.dll

See also

CoIsOle1Class
OleConvertIStorageToOLESTREAM
OleConvertOLESTREAMToIStorage
OleConvertOLESTREAMToIStorageEx
STGMEDIUM
TYMED

 

 

Community Additions

ADD
Show: