Partager via


IEventSource::Unadvise (Windows Embedded CE 6.0)

1/6/2010

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

Syntax

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 Value

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::OnStateChanged 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 Windows Embedded CE topic UPnP Samples.

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

Requirements

Header av_upnp.h
Library Av_upnp.lib
Windows Embedded CE Windows CE 5.0 and later

See Also

Reference

IEventSource
IEventSink
IEventSink::OnStateChanged
IEventSource::Advise
UPnPAVError

Concepts

Eventing in the UPnP AV Framework