DIWbemServices.DeleteClass

[This is preliminary documentation and subject to change.]

The DIWbemServices.DeleteClass method deletes the specified class from the current namespace. If there is a dynamic instance provider associated with the class, the provider is unregistered, and is no longer called for that class. Any classes that derive from the deleted class are also deleted, and their associated providers are unregistered. When the class is deleted, all outstanding static instances of the specified class and its subclasses are also deleted.

If the class is provided by a dynamic class provider, the success of the deletion depends on whether class deletion is supported by that provider.

Note  You cannot delete system classes.

DIWbemServices.DeleteClass(
  [in] Class As String, 
  [in] lFlags As Long, 
  [in] pCtx As Object, 
  [out, OPTIONAL] ppCallResult As Object  
) As Long
 

Parameters

Class
The name of the class targeted for deletion.
lFlags
Reserved. It must be zero.
pCtx
Typically NOTHING. Otherwise, this is a 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.
ppCallResultt
If NOTHING, the status of the call returns in the return code. If not NOTHING, the call becomes semisynchronous. The call returns immediately. This parameter receives a new DIWbemCallResult object that must be polled periodically by calling DIWbemCallResult.GetCallStatus to determine the final status of the operation. Using this technique, there may be many nonblocking calls to DeleteClass before you can check the status of any of them. In error cases where CIMOM cannot be reached, this parameter will be set to NOTHING.

See Error Objects.

Return Values

WBEM_E_ACCESS_DENIED The current user does not have permission to delete classes.
WBEM_E_FAILED Unspecified error.
WBEM_E_INVALID_CLASS The specified class does not exist.
WBEM_E_INVALID_OPERATION Deletion is not supported for the specified class. It may have been a system class or a class supplied by a dynamic provider that does not support class deletion.
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.

For more information on return values see Visual Basic error handeling and return values.

See Also

Error Objects, DIWbemServices.DeleteClassAsync