SWbemQualifierSet.Add method
The Add method of the SWbemQualifierSet object adds an SWbemQualifier object to the SWbemQualifierSet collection. If a qualifier with the same name already exists in the collection, it is replaced.
For an explanation of this syntax, see Document Conventions for the Scripting API.
Syntax
objQualifier = .Add( _
ByVal strName, _
ByVal varVal, _
[ ByVal bPropagatesToSubclasses ], _
[ ByVal bPropagatesToInstances ], _
[ ByVal bOverridable ], _
[ ByVal iFlags ] _
)
Parameters
-
strName [in]
-
Required. Name of the new qualifier.
-
varVal [in]
-
Required. Variant value of the new qualifier.
-
bPropagatesToSubclasses [in, optional]
-
Boolean value that indicates if this new qualifier is propagated to subclasses. The default value is TRUE.
-
bPropagatesToInstances [in, optional]
-
Boolean value that indicates if this new qualifier is propagated to instances. The default value is TRUE.
-
bOverridable [in, optional]
-
Boolean value that indicates if this qualifier can be overridden when propagated. The default value is TRUE.
-
iFlags [in, optional]
-
Reserved. The default value is 0.
Return value
If successful, this method returns an SWbemQualifier object that represents the new qualifier. Otherwise, a null object is returned.
Error codes
After completion of the Add method, the Err object may contain one of the error codes in the following list.
-
wbemErrInvalidParameter - 2147749896 (0x80041008)
-
The iFlags parameter was not valid.
-
wbemErrFailed - 2147749889 (0x80041001)
-
Unspecified error.
-
wbemErrCannotBeKey - 2147749919 (0x8004101F)
-
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.
-
wbemErrInvalidQualifierType - 2147749929 (0x80041029)
-
The varVal parameter is not of a legal qualifier type.
-
wbemErrOverrideNotAllowed - 2147749914 (0x8004101A)
-
It is not possible to perform the SWbemQualifierSet.Add operation on this qualifier because the owning object does not permit overrides.
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows Vista |
Minimum supported server |
Windows Server 2008 |
Header |
|
Type library |
|
DLL |
|
CLSID |
CLSID_SWbemQualifierSet |
IID |
IID_ISWbemQualifierSet |
See also
Σχόλια
https://aka.ms/ContentUserFeedback.
Σύντομα διαθέσιμα: Καθ' όλη τη διάρκεια του 2024 θα καταργήσουμε σταδιακά τα ζητήματα GitHub ως μηχανισμό ανάδρασης για το περιεχόμενο και θα το αντικαταστήσουμε με ένα νέο σύστημα ανάδρασης. Για περισσότερες πληροφορίες, ανατρέξτε στο θέμα:Υποβολή και προβολή σχολίων για