IMMDeviceActivate Method

Creates a COM object with the specified interface

Definition

Namespace: DevCase.Win32.Interfaces
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[PreserveSigAttribute]
HResult Activate(
	ref Guid refId,
	int clsCtx,
	IntPtr activationParams,
	ref Object refInterface
)

Parameters

refId  Guid
The interface identifier.

This parameter is a reference to a GUID that identifies the interface that the caller requests be activated.

The caller will use this interface to communicate with the COM object.

clsCtx  Int32
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.

Alternatively, the client can avoid imposing any context restrictions by specifying CLSCTX_ALL.

activationParams  IntPtr
Set to Zero to activate an IAudioClient, IAudioEndpointVolume, IAudioMeterInformation, IAudioSessionManager, or IDeviceTopology interface on an audio endpoint device.

When activating an IBaseFilter, IDirectSound, IDirectSound8, IDirectSoundCapture, or IDirectSoundCapture8 interface on the device, the caller can specify a pointer to a PROPVARIANT structure that contains stream-initialization information.

refInterface  Object
Pointer to a pointer variable into which the method writes the address of the interface specified by parameter refId.

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(Guid, Int32, IntPtr, Object) call fails, refInterface is .

Return Value

HResult
If the method succeeds, it returns S_OK. If it fails, it returns an HResult value.

See Also