DWbemClassObject.GetNames

[This is preliminary documentation and subject to change.]

The DWbemClassObject.GetNames method retrieves the names of all of the properties in the object. Depending on user-supplied selection criteria, furthermore, it can retrieve a subset of the properties. You can retrieve these properties by using DWbemClassObject.Get for each name. This method can also return system properties.

DWbemClassObject.GetNames(
  [in] QualifierName As String,
  [in] lFlags As Long,
  [in] pQualifierVal  As VARIANT,
  [out] pNames() As String
) As Long
 

Parameters

QualifierName
String containing a qualifier name.
lFlags
See Remarks.
pQualifierVal
Can be NULL. If not NULL, it must be a valid VARIANT.
pNames
An array of strings that contain the names of the properties in the object.

Return Values

WBEM_E_FAILED Unspecified error.
WBEM_E_INVALID_PARAMETER One or more parameters were invalid, or an incorrect combination of flags and parameters was specified.
WBEM_E_OUT_OF_MEMORY There was not enough memory to complete the task.
WBEM_NO_ERROR Success.

Remarks

The names returned are controlled by a combination of flags and parameters. For example, all names of all properties can be specified, or only the key properties, and so on. The lFlags parameter specifies the primary filter, and the other parameters vary depending on the value of lFlags. For example, if WBEM_FLAG_ONLY_IF_IDENTICAL is specified then a value must be specified for QualifierName and pQualifierVal.

The flag values are bit fields, and can be combined. You can combine one flag from each of the following groups with a flag from each of the other groups. Flag values within a group are mutually exclusive.

GROUP 1

WBEM_FLAG_ALWAYS
Returns all property names. QualifierName and pQualifierVal are reserved.
WBEM_FLAG_ONLY_IF_TRUE
Returns only properties that have a qualifier of the name specified by the parameter QualifierName. If you use this flag, you must specify QualifierName.
WBEM_FLAG_ONLY_IF_FALSE
Returns only properties that do not have a qualifier of the name specified by the parameter QualifierName. If you use this flag, you must specify QualifierName.
WBEM_FLAG_ONLY_IF_IDENTICAL
Returns only properties that have a qualifier of the name specified by the parameter QualifierName and have a value identical to the value specified by the VARIANT in pQualifierVal. If you use this flag, you must specify both QualifierName and pQualifierVal.

GROUP 2

WBEM_FLAG_KEYS_ONLY
Returns only the names of the property or properties that define the keys.
WBEM_FLAG_REFS_ONLY
Returns only property names that are object references.

GROUP 3

WBEM_FLAG_LOCAL_ONLY
Returns only property names that belong to the derived-most class, excluding properties from the superclass or superclasses.
WBEM_FLAG_PROPAGATED_ONLY
Returns only property names that belong to the superclass or superclasses.
WBEM_FLAG_SYSTEM_ONLY
Returns only system properties.
WBEM_FLAG_NONSYSTEM_ONLY
Returns only property names that are not system properties.

It is not an error for an empty list, that is, an array of zero elements, to be returned in situations where no properties match the specified filters.

See Also

DWbemClassObject.Get, System Properties, DWbemClassObject.BeginEnumeration