Expand Minimize

GetConvertStg function

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

Syntax


WINOLEAPI GetConvertStg(
  _In_  IStorage *pStg
);

Parameters

pStg [in]

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

Return value

S_OK

Indicates that the convert bit is set to TRUE.

S_FALSE

COM the convert bit is cleared (FALSE).

STG_E_ACCESSDENIED

Access denied because the caller does not have enough permissions, or another caller has the file open and locked.

STG_E_LOCKVIOLATION

Access denied because another caller has the file open and locked.

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

Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Header

Ole2.h

Library

Ole32.lib

DLL

Ole32.dll

See also

SetConvertStg

 

 

Community Additions

ADD
Show:
© 2014 Microsoft