// put all installed video and audio devices in the menus // void AddDevicesToMenu() { …… // enumerate all video capture devices ICreateDevEnum *pCreateDevEnum=0; hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, IID_ICreateDevEnum, (void**)&pCreateDevEnum); if(hr != NOERROR) { ErrMsg(TEXT("Error Creating Device Enumerator")); return; } IEnumMoniker *pEm=0; hr = pCreateDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &pEm, 0); if(hr != NOERROR) { ErrMsg(TEXT("Sorry, you have no video capture hardware.\r\n\r\n") TEXT("Video capture will not function properly.")); goto EnumAudio; } pEm->Reset(); ULONG cFetched; IMoniker *pM; while(hr = pEm->Next(1, &pM, &cFetched), hr==S_OK) { IPropertyBag *pBag=0; hr = pM->BindToStorage(0, 0, IID_IPropertyBag, (void **)&pBag); if(SUCCEEDED(hr)) { VARIANT var; |