DIWbemServices.CreateClassEnum

[This is preliminary documentation and subject to change.]

The DIWbemServices.CreateClassEnum method returns an enumerator for all classes satisfying the selection criteria.

The caller must use the returned enumerator to retrieve the class definitions, calling DIEnumWbemClassObject.Next to obtain each class.

Note that it is not an error for the returned enumerator to have zero elements.

DIWbemServices.CreateClassEnum(
  [in] Superclass As String,
  [in] lFlags As Long ,
  [in] pCtx As Object,
  [out]  ppEnum As Object
) As Long
 

Parameters

Superclass
Object of type DWbemContext

If not NOTHING or blank, specifies a superclass name. Only classes that are subclasses of this class are returned in the enumerator. If NOTHING or blank, and if lFlags is WBEM_FLAG_SHALLOW, only the top-level classes (that is, classes that have no parent class or superclass) are returned. If NOTHING or blank and lFlags is WBEM_FLAG_DEEP, all classes within the namespace are returned.

lFlags
WBEM_FLAG_DEEP forces recursive enumeration into all subclasses derived from the specified superclass. The superclass itself is not returned in the enumeration. WBEM_FLAG_SHALLOW forces the enumeration to include only immediate subclasses of the specified superclass.
pCtx
Typically NOTHING. Otherwise, this is an DWbemContext object required by the dynamic class provider that is producing the class instances. You must specify the values in the context object in the documentation for the provider in question.
ppEnum
Object of type DIEnumWbemClassObject.

Return Values

WBEM_E_ACCESS_DENIED The current user does not have permission to view one or more of the classes that the call can return.
WBEM_E_FAILED Unspecified error.
WBEM_E_INVALID_CLASS The specified class did not exist.
WBEM_E_INVALID_PARAMETER An invalid parameter was specified, or the namespace could not be parsed.
WBEM_E_OUT_OF_MEMORY There was not enough memory to complete the operation.
WBEM_NO_ERROR Success.

See Also

Error Objects, DIWbemServices.CreateClassEnumAsync, DIEnumWbemClassObject