Returns the current value of the convert bit for the specifed storage object.

HRESULT GetConvertStg(

IStorage * pStg
//Points to the storage object



Points to the storage object from which to retrieve the convert bit.

Return Values


Indicates the convert bit is set to TRUE.


Indicates the convert bit is cleared (FALSE).


Indicates cannot access the storage object.

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


This function is used by object applications that support converting the object from one format to another. The object application must be able to read the storage object using the format of its previous CLSID and write the object using the format of its new CLSID to support converting the object. 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, the object application 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 object application 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.

See Also


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