IMMDeviceCollection::GetCount Method

The GetCount method retrieves a count of the devices in the device collection.

Syntax

public:
HRESULT GetCount(
         UINT *pcDevices
)  

Parameters

pcDevices
Type: UINT *

[out]

Pointer to a UINT variable into which the method writes the number of devices in the device collection.

Return value

Type: HRESULT 

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 codes
Return code Description
E_POINTER Parameter pcDevices is NULL.

Refer to WASAPI error codes.

Remarks

For a code example that calls the GetCount method, see Device Properties.

Requirements

Header: Declared in mmdeviceapi.h.

Library: Use MMDevApi.lib.

See also

IMMDeviceCollection

IMMDeviceCollection Members