DeviceGetCount Method (IMFDevice)
device's type
number of available devices
Gets a number of available devices of the selected type
Syntax
Sub DeviceGetCount( _
   ByVal _eDevType As eMFDeviceType, _
   ByRef _pnCount As Integer _
) 
void DeviceGetCount( 
   eMFDeviceType _eDevType,
   out int _pnCount
)
procedure DeviceGetCount( 
    _eDevType: eMFDeviceType;
   Out  _pnCount: Integer
); 
void DeviceGetCount( 
   eMFDeviceType _eDevType,
   [PARAMFLAG::Out] int _pnCount
) 

Parameters

_eDevType
device's type
_pnCount
number of available devices
Example

Here is an example of how to fill a combobox with all available video devices:

comboBoxV.Items.Clear();
//Feel video devices
int vCount;
try
{
    m_objLive = new MFLiveClass();
    m_objLive.DeviceGetCount(eMFDeviceType.eMFDT_Video, out vCount);
    if (vCount > 0)
    {
        for (int i = 0; i < vCount; i++)
        {
            string strName;
            int _pbBusy;
            m_objLive.DeviceGetByIndex(eMFDeviceType.eMFDT_Video, i, out strName, out _pbBusy);
            comboBoxV.Items.Add(strName);
        }
        comboBoxV.SelectedIndex = 0;
    }
}
catch { }
See Also

Reference

IMFDevice Interface
IMFDevice Members