Skip to content

Latest commit

 

History

History
119 lines (93 loc) · 4.71 KB

nf-ole2-oledoautoconvert.md

File metadata and controls

119 lines (93 loc) · 4.71 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.OleDoAutoConvert
OleDoAutoConvert function (ole2.h)
Automatically converts an object to a new class if automatic conversion for that object class is set in the registry.
OleDoAutoConvert
OleDoAutoConvert function [COM]
_com_OleDoAutoConvert
com.oledoautoconvert
ole2/OleDoAutoConvert
com\oledoautoconvert.htm
com
fe470f8a-b2f0-48a4-a270-77420bd1472a
12/05/2018
OleDoAutoConvert, OleDoAutoConvert function [COM], _com_OleDoAutoConvert, com.oledoautoconvert, ole2/OleDoAutoConvert
ole2.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
Ole32.lib
Ole32.dll
Windows
19H1
OleDoAutoConvert
ole2/OleDoAutoConvert
c++
APIRef
kbSyntax
DllExport
Ole32.dll
OleDoAutoConvert

OleDoAutoConvert function

-description

Automatically converts an object to a new class if automatic conversion for that object class is set in the registry.

-parameters

-param pStg [in]

A pointer to the IStorage interface on the storage object to be converted.

-param pClsidNew [out]

A pointer to the new CLSID for the object being converted. If there was no automatic conversion, this may be the same as the original class.

-returns

This function can return the standard return values E_INVALIDARG, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following values.

Return code Description
S_OK
No conversion is needed or a conversion was successfully completed.
REGDB_E_KEYMISSING
The function cannot read a key from the registry.
 

This function can also return any of the error values returned by the OleGetAutoConvert function. When accessing storage and stream objects, see the IStorage::OpenStorage and IStorage::OpenStream methods for possible errors. When it is not possible to determine the existing CLSID or when it is not possible to update the storage object with new information, see the IStream interface for other error return values.

-remarks

OleDoAutoConvert automatically converts an object if automatic conversion has previously been specified in the registry by the OleSetAutoConvert function. Object conversion means that the object is permanently associated with a new CLSID. Automatic conversion is typically specified by the setup program for a new version of an object application, so that objects created by its older versions can be automatically updated.

The storage object must be in the unloaded state when OleDoAutoConvert is called.

A container application that supports object conversion should call OleDoAutoConvert each time it loads an object. If the container uses the OleLoad helper function, it need not call OleDoAutoConvert explicitly because OleLoad calls it internally.

OleDoAutoConvert first determines whether any conversion is required by calling the OleGetAutoConvert function, which, if no conversion is required, returns S_OK. If the object requires conversion, OleDoAutoConvert modifies and converts the storage object by activating the new object application. The new object application reads the existing data format, but saves the object in the new native format for the object application.

If the object to be automatically converted is an OLE 1 object, the ItemName string is stored in a stream called "\1Ole10ItemName." If this stream does not exist, the object's item name is NULL.

-see-also

OleGetAutoConvert

OleSetAutoConvert