IWbemQualifierSet::Put

[This is preliminary documentation and subject to change.]

The IWbemQualifierSet::Put method writes the named qualifier and value. If the qualifier does not exist, it is created. The new qualifier overwrites the previously existing value of the same name.

In some cases, it is not possible to write the value of a qualifier if it was propagated from another object. Propagated qualifiers are generally read-only, but they can be overridden in some cases. See Qualifier Flavors.

When writing the key qualifier, it is not necessary to specify any flavors or propagation rules.

HRESULT IWbemQualifierSet::Put(
  [in] BSTR bstrName,
  [in] VARIANT *pVal,
  [in] LONG lFlavor,
);
 

Parameters

bstrName
The name of the qualifier that is being written. This must point to a valid BSTR. The pointer is treated as read-only.
pVal
Cannot be NULL. This must point to a valid VARIANT that contains the qualifier value to be written. The pointer is treated as read-only. It is the caller's responsibility to call VariantClear on this pointer after the value is no longer needed.

Only variants of type VT_I4, VT_R8, VT_BSTR, VT_BOOL and arrays of types VT_BSTR, VT_I4, VT_R8, and VT_BOOL are supported.

lFlavor
The desired qualifier flavor for this qualifier. See Qualifier Flavors.
Not required if the qualifier is the key qualifier.

Return Values

WBEM_E_CANNOT_BE_KEY There was an illegal attempt to specify a key qualifier on a property that cannot be a key. The keys are specified in the class definition for an object, and cannot be altered on a per-instance basis.
WBEM_E_INVALID_PARAMETER An invalid parameter was specified or the namespace could not be parsed.
WBEM_E_INVALID_QUALIFIER_TYPE The pVal parameter is not of a legal qualifier type.
WBEM_E_OVERRIDE_NOT_ALLOWED It is not possible to perform the IWbemQualifierSet::Put operation on this qualifier because the owning object does not permit overrides.
WBEM_NO_ERROR Success.

See Also

Qualifier Flavors