我用 VFW 的 capGetDriverDescription 只能获得驱动信息,并不能知道当前真正插入USB,与电脑连接好的摄像头信息。
比如我有两个摄像头,针对每一个在程序中要有不同的处理,请问怎么能判断出来?谢谢~~~

解决方案 »

  1.   

    用循环语句
    for (Index = 0; Index < MAX_VFW_DEVICES; Index++)
             {
                if (capGetDriverDescription(Index,
                                            szDeviceName,
                                            sizeof(szDeviceName),
                                            szDeviceVersion,
                                            sizeof(szDeviceVersion)))
                {
                   try
                   {
                      //index为你usb设备的索引
                      if (capDriverConnect(m_hWndVideo, Index))
                      {
                         m_ValidDriverIndex[m_TotalVideoDrivers] = Index;
                         m_TotalVideoDrivers++;
                         capDriverDisconnect(m_hWndVideo);
                      }
       }
    }
      

  2.   

    try catch...我怎么没想到呢,呵呵已经成功了,谢了~~