var.vt = VT_BSTR; hr = pBag->Read(L"FriendlyName", &var, NULL); if(hr == NOERROR) { AppendMenu(hMenuSub, MF_STRING, MENU_VDEVICE0 + uIndex, W2T(var.bstrVal)); if(gcap.pmVideo != 0 && (S_OK == gcap.pmVideo->IsEqual(pM))) bCheck = TRUE; CheckMenuItem(hMenuSub, MENU_VDEVICE0 + uIndex, (bCheck ? MF_CHECKED : MF_UNCHECKED)); EnableMenuItem(hMenuSub, MENU_VDEVICE0 + uIndex, (gcap.fCapturing ? MF_DISABLED : MF_ENABLED)); bCheck = FALSE; SysFreeString(var.bstrVal); ASSERT(gcap.rgpmVideoMenu[uIndex] == 0); gcap.rgpmVideoMenu[uIndex] = pM; pM->AddRef(); } pBag->Release(); } pM->Release(); uIndex++; } pEm->Release(); |