Index   Commented   Search   About

SetConvertStg

Indicates whether the object is to be automatically converted to a different CLSID. It does this by setting the conversion bit in a storage object. The setting can be retrieved with a call to the GetConvertStg function.

HRESULT SetConvertStg(

IStorage * pStg,
//Storage object where the conversion bit is to be set
BOOL fConvert
//Indicates whether an object is to be converted
);

Parameters

pStg

Specifies the storage object in which to set the conversion bit.

fConvert

If TRUE, sets the conversion bit for the object. If FALSE, clears the conversion bit.

Return Values

S_OK

Indicates the object's conversion bit was set successfully.

STG_E_ACCESSDENIED

Indicates access to the storage object is not available.

E_OUTOFMEMORY

Indicates the conversion bit was not set due to a lack of memory.

E_INVALIDARG

Indicates one or more arguments are invalid.

E_UNEXPECTED

Indicates an unexpected error occurred.

See the IStorage::CreateStream, IStorage::OpenStream, IStream::Read, and IStream::Write methods for possible storage and stream access errors.

Comments

As part of converting an object from one class to another, container applications call SetConvertStg to set the conversion bit in the storage object. The bit is set to TRUE, indicating that the object has been tagged for conversion to a new class the next time it is loaded.

To retrieve the value of the conversion bit, an object application calls the GetConvertStg function when it is loading the object. If the bit is set, the object application converts the object to the new CLSID. To reset an object's conversion bit, the object application calls the SetConvertStg function with the fConvert parameter set to FALSE.

See Also

GetConvertStg

Related Links

Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
TMS Scripter Studio Pro components for Delphi/C++Builder

More Online Helps

Win32 Programmer's Reference (win32.hlp)
Win32 Multimedia Programmer's Reference (mmedia.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (sock2.hlp)
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008 Free Tect Secrets ;) greatis just4fun network just4fun