4.4 Removing a Subscription

Figure 4: Removing a subscription
The previous figure shows the sequence of a client application that submits a request to a server to remove all subscriptions with its subscriber CLSID. From before, the client knows that its SubscriberCLSID is 19D10A70-1B07-4b76-87B6-99F58DEE37E7.
The client activates the class ID CLSID_EventSystem to get the EventSystem DCOM object on the server.
The client calls the Remove method with the appropriate collection name for subscriptions (that is, "EventSystem.EventSubscriptionCollection"), along with the criteria for removing it.
HRESULT Remove( [in] BSTR progID = "EventSystem.EventSubscriptionCollection", [in] BSTR queryCriteria = "SubscriberCLSID='{19D10A70-1B07-4b76-87B6-99F58DEE37E7}'", [out] int* errorIndex = (uninitialized) );
As a result of this method call, the server finds all the subscriptions with that subscriber CLSID, removes them, and returns the following.
-
HRESULT = S_OK Remove( [in] BSTR progID = {unchanged}, [in] BSTR queryCriteria = {unchanged}, [out] int* errorIndex = 0 );
Note that the same set of operations can be performed by the client application to remove an event class.