Export (0) Print
Expand All

OleConvertOLESTREAMToIStorageEx function

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


WINOLEAPI OleConvertOLESTREAMToIStorageEx(
  _In_  LPOLESTREAM lpolestm,
  _Out_ IStorage    *pstg,
  _Out_ CLIPFORMAT  *pcfFormat,
  _Out_ LONG        *plWidth,
  _Out_ LONG        *plHeight,
  _Out_ DWORD       *pdwSize,
  _Out_ STGMEDIUM   pmedium
);

Parameters

lpolestm [in]

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

pstg [out]

Pointer to the OLE 2 structured storage object.

pcfFormat [out]

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

plWidth [out]

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

plHeight [out]

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

pdwSize [out]

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

pmedium [out]

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

Return value

S_OK

The conversion was completed successfully.

DV_E_TYMED

Value of the tymed member of STGMEDIUM is not TYMED_ISTREAM or TYMED_NULL.

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

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
OleConvertIStorageToOLESTREAMEx
OleConvertOLESTREAMToIStorage
STGMEDIUM
TYMED

 

 

Community Additions

ADD
Show:
© 2015 Microsoft