Share via


IEventSink::OnStateChanged

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This method is called when a state variable maintained by a service changes.

Syntax

virtual DWORD OnStateChanged(
  LPCWSTR pszStateVariableName,
  LPCWSTR pszValue
) = 0;
virtual DWORD OnStateChanged(
  LPCWSTR pszStateVariableName,
  long nValue
) = 0;
virtual DWORD OnStateChanged(
  LPCWSTR pszStateVariableName,
  LPCWSTR pszChannel,
  long nValue
) = 0;

Parameters

  • pszStateVariableName
    [in] Name of the state variable that has changed.
  • pszValue
    [in] New value of the state variable that has changed. Used when the state variable is a string.
  • nValue
    [in] New value of the state variable that has changed. Used when the state variable is a number.
  • pszChannel
    [in] Audio channel associated with the changing state variable. Used with RenderingControl service state variable changes that involve an audio channel.

Return Value

Custom implementations can return appropriate error codes. If this method succeeds, it should return SUCCESS_AV. Otherwise, it 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

This method is overloaded to handle notifications that contain string and long integer data types, as well as to handle notifications that contain channel information.

Control points and other applications implement this method to receive state variable change notifications from services.

Services accept references to IEventSink interfaces (through IEventSource::Advise) and then call OnStateChanged on these accepted references to notify the interested parties of state changes.

The implementation of these methods provided by the UPnP AV Framework uses UPnP event subscriptions and UPnP event notifications to connect control points and devices. From the perspective of code in the control point and device implementation, the device calls OnStateChanged and the corresponding OnStateChanged method is called in the control point's IEventSink implementation. The UPnP AV Framework implements this connection using proxy classes that in turn use UPnP eventing.

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
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

IEventSink
IEventSink
IEventSource::Advise
UPnPAVError

Concepts

Eventing in the UPnP AV Framework