DIWbemQualifierSet.Put

[This is preliminary documentation and subject to change.]

The DIWbemQualifierSet.Put method writes the named qualifier and value. If the qualifier does not exist, the method creates one. When the method creates a new qualifier, it overwrites a previously existing value of the same name.

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

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

DIWbemQualifierSet.Put(
  [in] Name As String,
  [in] pVal As VARIANT ,
  [in] lFlavor As Long,
) As Long
 

Parameters

Name
The name of the qualifier that is being written.
pVal
Cannot be NULL. This must be a valid VARIANT that contains the qualifier value before you can write it.
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 class definition specifies the keys for an object. It 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 DIWbemQualifierSet.Put operation on this qualifier, because the owning object does not permit overrides.
WBEM_NO_ERROR Success.

See Also

Qualifier Flavors