OleDoAutoConvert
Automatically
converts an object to a new class if automatic conversion for that object class
is set in the registry.
WINOLEAPI OleDoAutoConvert(
IStorage *
pStg, |
//Pointer to storage object to be converted |
LPCLSID pClsidNew |
//Pointer to new CLSID of converted object |
); |
|
Parameters
pStg
[in] Pointer
to the IStorage
pClsidNew
[out]
Pointserto the new CLSID for the object being converted. If there was no
automatic conversion, this may be the same as the original class.
Return Values
This function
supports the standard return values E_INVALIDARG, E_OUTOFMEMORY, and
E_UNEXPECTED, as well as the following:
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
Remarks
The OleDoAutoConvert
function automatically converts an object if automatic conversion has
previously been specified in the registry by the OleSetAutoConvert
A container
application that supports object conversion should call OleDoAutoConvert
each time it loads an object. If the container uses the OleLoad
OleDoAutoConvert first determines whether any conversion is required
by calling the OleGetAutoConvert
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.
The storage
object must be in the unloaded state when OleDoAutoConvert is called.
See Also