[This is preliminary documentation and subject to change.]
The DIWbemServices.DeleteClassAsync method deletes the specified class from the current namespace. This method is identical to DIWbemServices.DeleteClass, except that the call returns immediately. After the operation is done, you can use the DIWbemObjectSink.SetStatus method to report asynchronously to the specified object sink whether the deletion was successful or not.
DIWbemServices.DeleteClassAsync(
[in] Class As String,
[in] lFlags As Long,
[in] pCtx As Object,
[in] pResponseHandler As Object
) As Long
WBEM_E_FAILED | Unspecified error. |
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. |
All other return codes are provided to the object sink specified by the pReponseHandler parameter through the SetStatus method. Error conditions, such as when the class does not exist or the user does not have permission to delete classes, are reported to the handler. Error conditions are not reported in the return code of this method.
If a dynamic instance provider is 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 become unregistered. All outstanding static instances of the specified class and its subclasses are also deleted when the class is deleted.
If the class is provided by a dynamic class provider, the success of the deletion depends on whether that provider supports the class deletion.
Note Standard system classes cannot be deleted.
Asynchronous Methods, DIWbemServices.DeleteClass