Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
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 IEventSinkinterfaces (through IEventSource::Advise) and then call OnStateChangedon 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 OnStateChangedand the corresponding OnStateChangedmethod is called in the control point's IEventSinkimplementation. 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