Using the Service Callback Interface
Other versions of this page are also available for the following:
8/27/2008
If you need to send feedback to the client on a pending asynchronous call, you can implement the ICcServiceCB interface. Using this method, you can inform a client when there is a state change, or inform a client of progress on a lengthy task, such as downloading a run-time image to a target device.
The Core Connectivity infrastructure provides the service callback interface through IConnectionPointContainer.
The following steps show how to use the callback features:
- Implement ICcServiceCB on an object.
- Call IUnknown::QueryInterface for IConnectionPointContainer.
- Call IConnectionPointContainer::FindConnectionPoint.
This returns a connection point object for the interface specified in this call.
Because connectivity services support only the ICcServiceCB connection sink, clients must pass in the IID for that interface in this call. - Call IConnectionPoint::Advise.
This registers the client for callback notifications.
Clients must pass in the ICcServiceCB implementation in this call. - Get callback notifications.
- Call IConnectionPoint::Unadvise
Clients must call this API to de-register the connection point sink.
The cookie parameter used in this call is the same cookie returned by the service in the call to IConnectionPoint::Advise. After this call is made, the client no longer receives callback notifications.
See Also
Concepts
Kernel Transport Services
Application Transport Services
Application Download Services