Converts the specified object from the OLE 1 storage model to an OLE 2 structured storage object without specifying presentation data. This is one of several compatibility functions.
WINOLEAPI OleConvertOLESTREAMToIStorage(
LPOLESTREAM lpolestream, //Pointer to the stream where the OLE 1
// storage is written
IStorage * pstg, //Pointer to OLE 2 storage object
const DVTARGETDEVICE * ptd //Pointer to target device
);
This function supports the standard return value E_INVALIDARG, as well as the following:
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.
On entry, the lpolestm parameter should be created and positioned just as it would be for an OleLoadFromStream function call. On exit, the lpolestm parameter is positioned just as it would be on exit from an OleLoadFromStream function, and the pstg parameter contains the uncommitted persistent representation of the OLE 2 storage object.
For OLE 1 objects that use native data for their presentation, the OleConvertOLESTREAMToIStorage function returns CONVERT10_S_NO_PRESENTATION. On receiving this return value, callers should call IOleObject::Update to get the presentation data so it can be written to storage.
Applications that do not use OLE's default caching resources, but do use the conversion resources, can use an alternate function, OleConvertOLESTREAMToIStorageEx, which can specify which presentation data to convert. In the OleConvertOLESTREAMToIStorageEx function, 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.
The following steps describe the conversion process using OleConvertOLESTREAMToIStorage:
pstg->lpVtbl->CreateStorage(...&pStgChild);
hRes = OleConvertIStorageToOLESTREAM(polestm, pStgChild);
hRes = OleLoad(pStgChild, &IID_IOleObject, pClientSite, ppvObj);
Windows NT: Use version 3.1 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in ole2.h.
Import Library: Included as a resource in ole32.dll.
CoIsOle1Class, OleConvertIStorageToOLESTREAM, OleConvertIStorageToOLESTREAMEx, OleConvertOLESTREAMToIStorageEx, DVTARGETDEVICE structure, STGMEDIUM structure, TYMED enumeration