GetConvertStg function (coml2api.h)

The GetConvertStg function returns the current value of the convert bit for the specified storage object.

Syntax

HRESULT GetConvertStg(
  [in] LPSTORAGE pStg
);

Parameters

[in] pStg

IStorage pointer to the storage object from which the convert bit is to be retrieved.

Return value

IStorage::OpenStream, IStorage::OpenStorage, and ISequentialStream::Read storage and stream access errors.

Remarks

The GetConvertStg function is called by object servers that support the conversion of an object from one format to another. The server must be able to read the storage object using the format of its previous class identifier (CLSID) and write the object using the format of its new CLSID to support the object's conversion. For example, a spreadsheet created by one application can be converted to the format used by a different application.

The convert bit is set by a call to the SetConvertStg function. A container application can call this function on the request of an end user, or a setup program can call it when installing a new version of an application. An end user requests converting an object through the Convert To dialog box. When an object is converted, the new CLSID is permanently assigned to the object, so the object is subsequently associated with the new CLSID.

Then, when the object is activated, its server calls the GetConvertStg function to retrieve the value of the convert bit from the storage object. If the bit is set, the object's CLSID has been changed, and the server must read the old format and write the new format for the storage object.

After retrieving the bit value, the object application should clear the convert bit by calling the SetConvertStg function with its fConvert parameter set to FALSE.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header coml2api.h (include Ole2.h)
Library Ole32.lib
DLL Ole32.dll

See also

SetConvertStg