ISettingsItem::CreateListElement method (wcmconfig.h)

Creates a new list element.

Syntax

HRESULT CreateListElement(
  [in]  const VARIANT *KeyData,
  [out] ISettingsItem **Child
);

Parameters

[in] KeyData

The information for the key that defines the identity of the new list item. To determine the correct value for the key data parameter, consult the information returned from ISettingsItem::GetListKeyInformation. The variant obtained from ISettingsItem::GetListKeyInformation should be coercible to the type of the key. If the ISettingsItem::GetListKeyInformation method returns S_FALSE, use a string type for the key data.

[out] Child

A pointer to the newly created ISettingsItem list item.

Return value

This method can return one of these values.

Return code Description
S_OK
Indicates success.
HRESULT_FROM_WIN32 (ERROR_INVALID_OPERATION)
Indicates that the method is called on an item that is not of setting type list.
WCM_E_INVALIDVALUE, WCM_E_INVALIDVALUEFORMAT, or WCM_E_INVALIDDATATYPE
Indicates an attempt to create a list where the key cannot be coerced to the correct type.
WCM_E_READONLYITEM
Indicates that the item cannot be written, either because it is a read-only item, or because the namespace was opened in ReadOnly mode.

Remarks

Note  When creating a scalar list item, you must set a value on the resulting ISettingsItem before releasing it, or it will not be persisted.
 

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header wcmconfig.h
DLL SMIEngine.dll

See also

ISettingsItem