Skip to content

Latest commit

 

History

History
145 lines (99 loc) · 5.69 KB

nf-ole2-oleconvertolestreamtoistorage.md

File metadata and controls

145 lines (99 loc) · 5.69 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:ole2.OleConvertOLESTREAMToIStorage
OleConvertOLESTREAMToIStorage function (ole2.h)
Converts the specified object from the OLE 1 storage model to an OLE 2 structured storage object without specifying presentation data.
OleConvertOLESTREAMToIStorage
OleConvertOLESTREAMToIStorage function [Structured Storage]
_stg_oleconvertolestreamtoistorage
ole2/OleConvertOLESTREAMToIStorage
stg.oleconvertolestreamtoistorage
stg\oleconvertolestreamtoistorage.htm
Stg
8fed879c-5f97-4450-8259-da9643dd828c
12/05/2018
OleConvertOLESTREAMToIStorage, OleConvertOLESTREAMToIStorage function [Structured Storage], _stg_oleconvertolestreamtoistorage, ole2/OleConvertOLESTREAMToIStorage, stg.oleconvertolestreamtoistorage
ole2.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
Ole32.lib
Ole32.dll
Windows
19H1
OleConvertOLESTREAMToIStorage
ole2/OleConvertOLESTREAMToIStorage
c++
APIRef
kbSyntax
DllExport
Ole32.dll
OleConvertOLESTREAMToIStorage

OleConvertOLESTREAMToIStorage function

-description

The OleConvertOLESTREAMToIStorage function converts the specified object from the OLE 1 storage model to an OLE 2 structured storage object without specifying presentation data.

Note  This is one of several compatibility functions.
 

-parameters

-param lpolestream [in]

A pointer to a stream that contains the persistent representation of the object in the OLE 1 storage format.

-param pstg [out]

A pointer to the IStorage interface on the OLE 2 structured storage object.

-param ptd [in]

A pointer to the DVTARGETDEVICE structure that specifies the target device for which the OLE 1 object is rendered.

-returns

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

-remarks

This function converts an OLE 1 object to an OLE 2 structured storage object. 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 the OLE default caching resources, but use the conversion resources, can use an alternate function, OleConvertOLESTREAMToIStorageEx, which can specify the 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 procedure describes the conversion process using OleConvertOLESTREAMToIStorage.

Converting an OLE 1 object to an OLE 2 storage object

  1. Create a root IStorage object by calling the StgCreateDocfile function (..., &pstg).
  2. Open the OLE 1 file (using OpenFile or another OLE 1 technique).
  3. Read from the file, using the OLE 1 procedure for reading files, until an OLE object is found.
  4. Allocate an IStorage object from the root IStorage created in Step 1.
    pstg->lpVtbl->CreateStorage(...&pStgChild); 
    hRes = OleConvertIStorageToOLESTREAM(polestm, pStgChild); 
    hRes = OleLoad(pStgChild, &IID_IOleObject, pClientSite, ppvObj);
  5. Repeat Step 3 until the file is completely read.

-see-also

CoIsOle1Class

DVTARGETDEVICE

OleConvertIStorageToOLESTREAM

OleConvertIStorageToOLESTREAMEx

OleConvertOLESTREAMToIStorageEx

STGMEDIUM

TYMED