是什么导致 pMoniker->BindToObject 返回 800700c1

What's causing pMoniker->BindToObject to return 800700c1

本文关键字:BindToObject 返回 800700c1 gt pMoniker- 是什么      更新时间:2023-10-16

捕获设备有效,但绑定失败。800703E8通常表示未注册的过滤器。win10 - 64

        if (SUCCEEDED(hr))
            {
                char tempDevicePathUTF8[256];
                memset(tempDevicePathUTF8,0,256);
                tempDevicePathUTF8[0] = 0;
                WideCharToMultiByte(CP_UTF8, 0, varName.bstrVal, -1,
                                    tempDevicePathUTF8,
                                    sizeof(tempDevicePathUTF8), NULL,
                                    NULL);
                if (strncmp(tempDevicePathUTF8,
                            (const char*) deviceUniqueIdUTF8,
                            deviceUniqueIdUTF8Length) == 0)
                {
                    // We have found the requested device
                    deviceFound = true;
                    hr = pM->BindToObject(0, 0, IID_IBaseFilter,
                                          (void**) &captureFilter);
                    if FAILED(hr)
                    {
                        WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture,
                                     _id, "Failed to bind to the selected capture device %d",hr);
                    }
                    if (productUniqueIdUTF8
                        && productUniqueIdUTF8Length > 0) // Get the device name
                    {
                        GetProductId(deviceUniqueIdUTF8,
                                     productUniqueIdUTF8,
                                     productUniqueIdUTF8Length);
                    }
                }
            }

这是webtc中常见的捕获步骤,可以在大多数计算机上运行良好,但这个特定的

0x800700C1ERROR_BAD_EXE_FORMAT,这表明捕获设备有问题(即使您认为它是有效的)。一个典型的问题是设备正确地注册了32位应用程序,但没有注册64位应用程序(反之亦然)。无论哪种方式,这都是特定DirectShow过滤器的COM注册问题。