CComPtr<IDeviceCollection> pDevices; HRESULT hr = m_pUM->get_Devices(&pDevices); if(FAILED(hr)) { ATLTRACE("m_pUM->get_Devices failed\n"); return; }