OleConvertIStorageToOLESTREAM

Converts the specified storage object from OLE 2 structured storage to the OLE 1 storage model but does not include the presentation data. This is one of several compatibility functions. You can use these functions to determine if an object class is from OLE 1 and to convert objects between OLE 1 and OLE 2 storage formats.

HRESULT OleConvertIStorageToOLESTREAM(

IStorage * pStg,
//Points to the OLE 2 storage object to be converted
LPOLESTREAM lpolestm
//Points to the stream where the OLE1 storage is written
);

Parameters

pStg

Points to the storage object to be converted to an OLE 1 storage.

lpolestm

Points to a stream where the persistent representation of the object is saved using the OLE 1 storage model.

Return Values

S_OK

Indicates the storage object was successfully converted and the OLESTREAM structure contains the persistent representation of an OLE 1 object.

CONVERT10_E_STG_NO_STD_STREAM

Indicates object cannot be converted because its storage is missing a stream.

CONVERT10_S_NO_PRESENTATION

Indicates the specified storage object contains a Paintbrush object in DIB format and there is no presentation data in the OLESTREAM.

E_INVALIDARG

Indicates invalid value for the pstg or lpolestm parameters.

Comments

This function converts an OLE 2 storage object to OLE 1 format. The OLESTREAM code implemented for OLE 1 must be available.

On entry, the stream pointed to by lpolestm should be created and positioned just as it would be for an OleSaveToStream call. On exit, the stream contains the persistent representation of the object using OLE 1 storage.

Note Paintbrush objects are dealt with differently from other objects because their native data is in DIB format. When Paintbrush objects are converted using OleConvertIStorageToOLESTREAM, no presentation data is added to the OLESTREAM. To include presentation data, use the OleConvertIStorageToOLESTREAMEx function instead.

See Also

CoIsOle1Class, OleConvertIStorageToOLESTREAMEx, OleConvertOLESTREAMToIStorage, OleConvertOLESTREAMToIStorageEx

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database