LONG Count; hr = pDevices->get_Count(&Count); if(FAILED(hr)) { ATLTRACE("pDevices->get_Count failed\n"); return; }