DIWbemServices.DeleteClassAsync

[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
 

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.
pResponseHandler
The implementation of DIWbemObjectSink implemented by the caller. The handler receives the status of the deletion request when the DIWbemObjectSink.SetStatus method makes the status available. For a detailed explanation of this parameter, see Asynchronous Methods.

Return Values

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.

Remarks

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.

See Also

Asynchronous Methods, DIWbemServices.DeleteClass