OleConvertIStorageToOLESTREAMEx  C6W.FN

Converts the specified storage object from OLE 2 structured storage to the OLE 1 storage model, including the presentation data. This is one of several compatibility functions.

WINOLEAPI OleConvertIStorageToOLESTREAMEx(

    IStorage  * pStg,

//Pointer to the OLE 2 storage object to be converted

    CLIPFORMAT  cfFormat,

//Presentation data format

    LONG  lWidth,

//Width in HIMETRIC

    LONG  lHeight,

//Height in HIMETRIC

    DWORD  dwSize,

//Size of data

    STGMEDIUM  pmedium,

//Pointer to data

    LPOLESTREAM  lpolestm

//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.

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 STGMEDIUM0NJIOV structure for the serialized data to be converted. See STGMEDIUM for more information.

lpolestm

[out] Pointer to a stream 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 conversion was completed successfully.

DV_E_STGMEDIUM

The hGlobal member of STGMEDIUM0NJIOV 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 OleConvertIStorageToOLESTREAM30WNOT function in that the presentation data to be written to the OLE 1 storage is passed in.

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 STGMEDIUM0NJIOV must be either TYMED_HGLOBAL or TYMED_ISTREAM; refer to the TYMED1QNCE4N enumeration for more information. The medium is not released by OleConvertIStorageToOLESTREAMEx.

See Also

CoIsOle1Class, OleConvertIStorageToOLESTREAM, OleConvertOLESTREAMToIStorage, OleConvertOLESTREAMToIStorageEx, STGMEDIUM, TYMED