Determines whether the registry is set for objects of a specified CLSID to be automatically converted to another CLSID, and if so, retrieves the new CLSID.
WINOLEAPI OleGetAutoConvert(
REFCLSID clsidOld, |
//CLSID of the object to be converted |
LPCLSID pClsidNew |
//Pointer to new CLSID for object being converted |
); |
Parameters
Return Values
This function supports the standard return values E_INVALIDARG, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following:
Remarks
The OleGetAutoConvert function returns the AutoConvertTo entry in the registry for the specified object. The AutoConvertTo subkey specifies whether objects of a given CLSID are to be automatically converted to a new CLSID. This is usually used to convert files created by older versions of an application to the current version. If there is no AutoConvertTo entry, this function returns the value of clsidOld.
The OleDoAutoConvert function calls OleGetAutoConvert to determine if the object specified is to be converted. 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.
To set up automatic conversion of a given class, you can call the OleSetAutoConvert function (typically in the setup program of an application installation). This function uses the AutoConvertTo subkey to tag a class of objects for automatic conversion to a different class of objects. This is a subkey of the CLSID key, and contains the following information:
CLSID\{clsid}=MainUserTypeName\AutoConvertTo = clsid
See Also
OleSetAutoConvert, OleDoAutoConvert