IPropertyStorage::SetClass method (propidlbase.h)

The SetClass method assigns a new CLSID to the current property storage object, and persistently stores the CLSID with the object.

Syntax

HRESULT SetClass(
  [in] REFCLSID clsid
);

Parameters

[in] clsid

New CLSID to be associated with the property set.

Return value

This method supports the standard return value E_UNEXPECTED, in addition to the following:

Remarks

Assigns a CLSID to the current property storage object. The CLSID has no relationship to the stored property IDs. 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 (UI). Different CLSIDs can be associated with different property set instances that have the same FMTID.

If the property set is created with the pclsid parameter of the IPropertySetStorage::Create method specified as NULL, 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 nonsimple 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.

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 propidlbase.h (include Objbase.h, Propidlbase.h)
Library Uuid.lib
DLL Ole32.dll

See also

IPropertySetStorage::Create

IPropertyStorage

IPropertyStorage::Stat