IPropertyStorage::SetClass

Assigns a new CLSID to the current property storage object, and persistently stores the CLSID with the object.

HRESULT SetClass(
  REFCLSID clsid  //New CLSID for the property set
);
 

Parameters

clsid
[in] New CLSID to be associated with the property set.

Return Values

This method supports the standard return value E_UNEXPECTED, as well as the following:

S_OK
The CLSID has been assigned.
STG_E_ACCESSDENIED
The requested access to the IPropertyStorage interface has been denied. The CLSID was not assigned.
STG_E_INSUFFICIENTMEMORY
There is not sufficient memory to perform this operation. The CLSID was not assigned.
STG_E_INVALIDPARAMETER
The parameter is invalid. The CLSID was not assigned.

Remarks

Assigns a CLSID to the current property storage object. The CLSID has no relationship to the stored property identifiers. Assigning a CLSID allows a piece of code to be associated with a given instance of a property set; such code, for example, might manage the user interface. Different CLSIDs can be associated with different property set instances that have the same FMTID.

If the property set is created with NULL specified as the IPropertySetStorage::Create pclsid parameter, the CLSID is set to all zeroes.

The current CLSID on a property storage object can be retrieved with a call to IPropertyStorage::Stat. The initial value for the CLSID can be specified at the time that the storage is created with a call to IPropertySetStorage::Create.

Setting the CLSID on a non-simple property set (one that can legally contain storage- or stream-valued properties, as described in IPropertySetStorage::Create) also sets the CLSID on the underlying sub-storage.

QuickInfo

  Windows NT: Use version 4.0 or later.
  Windows: Use Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in objidl.h.

See Also

IPropertySetStorage::Create, IPropertyStorage::Stat