次の方法で共有


IPart::Activate

Previous Next

IPart::Activate

The Activate method activates a function-specific interface on a connector or subunit.

HRESULT Activate(
  DWORD  dwClsContext,
  REFIID  refiid,
  void  **ppvObject
);

Parameters

dwClsContext

[in]  The execution context in which the code that manages the newly created object will run. The caller can restrict the context by setting this parameter to the bitwise OR of one or more CLSCTX enumeration values. The client can avoid imposing any context restrictions by specifying CLSCTX_ALL. For more information about CLSCTX, see the Windows SDK documentation.

refiid

[in]  The interface ID for the requested control function. The client should set this parameter to one of the following REFIID 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

For more information, see Remarks.

ppvObject

[out]  Pointer to a pointer variable into which the method writes the address of the interface that is specified by parameter refiid. Through this method, the caller obtains a counted reference to the interface. The caller is responsible for releasing the interface, when it is no longer needed, by calling the interface's Release method. If the Activate call fails, *ppObject is NULL.

Return Value

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 The CLSCTX_INPROC_SERVER bit in dwClsContext is zero.
E_POINTER Pointer ppvObject is NULL.
E_NOINTERFACE The part object does not support the requested interface.

Remarks

The Activate method supports the following function-specific control interfaces:

To obtain the interface ID of the function-specific control interface of 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.

Requirements

Client: Windows Vista

Header: Include Devicetopology.h.

See Also

Previous Next