USB Port Monitoring Control
USB Monitoring Control - USB Device Data Monitoring ActiveX Component Library

IDeviceCollection.Item Property

HHD Software - Hex Editor Serial Port Monitor USB Protocol Analyzer Network Monitor
 
 
 
< PreviousTopNext >
Declaration
Getting property value:
Automation:
IDevice  value = obj.Item ( [in]   Variant  Index) ;
Native (C++):
HRESULT  get_ Item ( [in]   VARIANT  Index, [out, retval]   IDevice * *  pVal) ;
Parameters
Index Zero-based device index. pVal Reference to Device object. Don't forget to release it.
C++
          CComPtr<IDeviceCollection> pDevices;
          
          HRESULT hr = m_pUM->get_Devices(&pDevices);
          if(FAILED(hr))
          {
            ATLTRACE("m_pUM->get_Devices failed\n");
            return;
          }
            
          CComPtr<IDevice> pDevice;
          int i = 0;
		      HRESULT hr = pDevices->get_Item(CComVariant(i),&pDevice);
		      if(FAILED(hr))
		      {
			        ATLTRACE("pDevices->get_Item failed\n");
			        return;
		      }
        
Return Value
Automation: Reference to Device object. Native: S_OK or standard OLE error code.
Remarks
Returns the device from the collection
< PreviousTopNext >
Copyright © 2011 HHD Software. All rights reserved.