Deleting a Class
Unlike deleting a dynamic instance, deleting a class is a simple procedure. However, as discussed earlier, base or derived classes are rarely deleted. Instead, an instance is more commonly deleted. The Scripting API for WMI uses the same methods to delete either a class object or an instance. For more information, see Deleting an Instance.
The COM API for WMI has different methods for deleting an instance and deleting an object.
The following procedure describes how to delete a base class or derived class.
To delete a base class or derived class
- Call either the
As the name suggests, DeleteClassAsync deletes an instance asynchronously while DeleteClass deletes an instance synchronously. To use DeleteClassAsync, you must also implement an IWbemObjectSink object.
Note Because the callback to the sink might not be returned at the same authentication level as the client requires, it is recommended that you use semisynchronous instead of asynchronous communication. For more information, see Calling a Method.