IPropertyStorage::SetClass method

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

clsid [in]

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:

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 enough memory to perform this operation. The CLSID was not assigned.

STG_E_INVALIDPARAMETER

The parameter is not valid. The CLSID was not assigned.

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

Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Header

Propidl.h (include Objbase.h)

Library

Uuid.lib

DLL

Ole32.dll

IID

IID_IPropertyStorage is defined as 00000138-0000-0000-C000-000000000046

See also

IPropertySetStorage::Create
IPropertyStorage::Stat

 

 

Community Additions

ADD
Show:
© 2014 Microsoft