Compartilhar via


IEventSource::Unadvise (Windows CE 5.0)

Send Feedback

This method is called to indicate that a provided IEventSink pointer should no longer be notified of state variable changes.

virtual DWORD Unadvise(  IEventSink *pSubscriber) = 0;

Parameters

  • pSubscriber
    [in] Pointer to the IEventSink pointer that should no longer be notified of state variable changes. This pointer should refer to an object that was passed to IEventSource::Advise.

Return Values

Custom implementations can return appropriate error codes. Should return SUCCESS_AV if the method succeeds. Otherwise, should return an error code defined in WinError.h or UPnP.h, or one of the UPnP AV-specific return values specified in UPnPAVError.

Remarks

Control points and other applications call this method, passing the same IEventSink pointer they passed to Advise, to indicate that IEventSink::OnStateChange should no longer be called when state variables change.

Services implement this method by setting their pointer to the passed IEventSink instance to NULL.

The implementation of this method provided by the UPnP AV Framework uses UPnP event subscriptions and UPnP event notifications to disconnect control points and device services. Calls to Unadvise in a control point are handled by a proxy that uses UPnP eventing to notify the service of the subscription ending. The provided device proxy receives the UPnP event communication and in turn calls the service's Unadvise implementation.

This means that the IEventSink implementation a control point passes is not the same as the IEventSink implementation received by the service. Instead, custom code interacts with proxy classes that communicate with each other.

Although multiple control points can subscribe to events from a single service, and pass multiple IEventSink implementations, the UPnP AV Framework device proxy hides the multiple client IEventSink implementations and passes a single IEventSink pointer to the service's Unadvise implementation.

For an example implementation of Unadvise in a device, see the AV Renderer sample. For example control point calls to Unadvise, see the AV Control Point Sample. Both samples are explained in more detail in UPnP Samples.

For more information about state variables defined for each service, see UPnP AV DCP Documentation.

Requirements

OS Versions: Windows CE 5.0 and later.
Header: Av_upnp.h.
Link Library: Av_upnp.lib.
C++ Namespace: av_upnp.

See Also

IEventSource | Eventing in the UPnP AV Framework | IEventSink | IEventSink::OnStateChange | IEventSource::Advise | UPnPAVError

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.