DIWbemServices.DeleteInstanceAsync

[This is preliminary documentation and subject to change.]

The DIWbemServices.DeleteInstanceAsync method performs the same function as DIWbemServices.DeleteInstance, except that the call returns immediately. The success or failure of the operation is asynchronously reported to the supplied object sink through the DIWbemObjectSink.SetStatus method.

If a dynamic provider supplied the instance, it is sometimes not possible to delete the instance unless the provider supports instance deletion.

DIWbemServices.DeleteInstanceAsync(
  [in] ObjectPath As String,                   
  [in] lFlags As Long,                       
  [in] pCtx As Object,                 
  [in] pResponseHandler As Object         
) As Long
 

Parameters

ObjectPath
A string containing the object path of the object to be deleted.
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 caller's implementation of DIWbemObjectSink. This handler receives the status of the delete operation as it becomes available through the SetStatus method. For a detailed explanation of this parameter, see Asynchronous Methods.

Return Values

WBEM_E_FAILED Unspecified error.
WBEM_E_INVALID_CLASS The specified class was invalid.
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

Other error conditions are reported asynchronously to the object sink supplied by the pResponseHandler parameter.

See Also

Asynchronous Methods, DIWbemServices.DeleteInstance, Object Paths