Skip to content

Latest commit

 

History

History
145 lines (111 loc) · 6.85 KB

nf-devicetopology-ipart-registercontrolchangecallback.md

File metadata and controls

145 lines (111 loc) · 6.85 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:devicetopology.IPart.RegisterControlChangeCallback
IPart::RegisterControlChangeCallback (devicetopology.h)
The RegisterControlChangeCallback method registers the IControlChangeNotify interface, which the client implements to receive notifications of status changes in this part.
IPart interface [Core Audio]
RegisterControlChangeCallback method
IPart.RegisterControlChangeCallback
IPart::RegisterControlChangeCallback
IPartRegisterControlChangeCallback
RegisterControlChangeCallback
RegisterControlChangeCallback method [Core Audio]
RegisterControlChangeCallback method [Core Audio]
IPart interface
coreaudio.ipart_registercontrolchangecallback
devicetopology/IPart::RegisterControlChangeCallback
coreaudio\ipart_registercontrolchangecallback.htm
CoreAudio
58cf52c9-20ee-46c4-926e-c374a4f42240
12/05/2018
IPart interface [Core Audio],RegisterControlChangeCallback method, IPart.RegisterControlChangeCallback, IPart::RegisterControlChangeCallback, IPartRegisterControlChangeCallback, RegisterControlChangeCallback, RegisterControlChangeCallback method [Core Audio], RegisterControlChangeCallback method [Core Audio],IPart interface, coreaudio.ipart_registercontrolchangecallback, devicetopology/IPart::RegisterControlChangeCallback
devicetopology.h
Windows
Windows Vista [desktop apps only]
Windows Server 2008 [desktop apps only]
Windows
19H1
IPart::RegisterControlChangeCallback
devicetopology/IPart::RegisterControlChangeCallback
c++
APIRef
kbSyntax
COM
Devicetopology.h
IPart.RegisterControlChangeCallback

IPart::RegisterControlChangeCallback

-description

The RegisterControlChangeCallback method registers the IControlChangeNotify interface, which the client implements to receive notifications of status changes in this part.

-parameters

-param riid [in]

The function-specific control interface that is to be monitored for control changes. For more information, see Remarks.

-param pNotify [in]

Pointer to the client's IControlChangeNotify interface. If the method succeeds, it calls the AddRef method on the client's IControlChangeNotify interface.

-returns

If the method succeeds, it returns S_OK. If it fails, possible return codes include, but are not limited to, the values shown in the following table.

Return code Description
E_INVALIDARG
Parameter riid is not a valid control-interface identifier.
E_POINTER
Pointer pNotify is NULL.

-remarks

Set parameter riid to one of the following GUID values:

  • IID_IAudioAutoGainControl
  • IID_IAudioBass
  • IID_IAudioChannelConfig
  • IID_IAudioInputSelector
  • IID_IAudioLoudness
  • IID_IAudioMidrange
  • IID_IAudioMute
  • IID_IAudioOutputSelector
  • IID_IAudioPeakMeter
  • IID_IAudioTreble
  • IID_IAudioVolumeLevel
  • IID_IDeviceSpecificProperty
  • IID_IKsFormatSupport
  • IID_IKsJackDescription
To obtain the interface ID of the function-specific control interface for a part, call the part's IControlInterface::GetIID method. To obtain the interface ID of a function-specific control interface type, use the __uuidof operator. For example, the interface ID of IAudioAutoGainControl is defined as follows:
const IID IID_IAudioAutoGainControl  __uuidof(IAudioAutoGainControl)

For more information about the __uuidof operator, see the Windows SDK documentation.

Before the client releases its final reference to the IControlChangeNotify interface, it should call the IPart::UnregisterControlChangeCallback method to unregister the interface. Otherwise, the application leaks the resources held by the IControlChangeNotify and IPart objects. Note that RegisterControlChangeCallback calls the client's IControlChangeNotify::AddRef method, and UnregisterControlChangeCallback calls the IControlChangeNotify::Release method. If the client errs by releasing its reference to the IControlChangeNotify interface before calling UnregisterControlChangeCallback, the IPart object never releases its reference to the IControlChangeNotify interface. For example, a poorly designed IControlChangeNotify implementation might call UnregisterControlChangeCallback from the destructor for the IControlChangeNotify object. In this case, the client will not call UnregisterControlChangeCallback until the IPart object releases its reference to the IControlChangeNotify interface, and the IPart object will not release its reference to the IControlChangeNotify interface until the client calls UnregisterControlChangeCallback. For more information about the AddRef and Release methods, see the discussion of the IUnknown interface in the Windows SDK documentation.

-see-also

IControlChangeNotify Interface

IControlInterface::GetIID

IPart Interface

IPart::UnregisterControlChangeCallback