Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/318.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 对COM组件的调用返回了DirectX捕获错误HRESULT E_FAIL_C#_Wpf - Fatal编程技术网

C# 对COM组件的调用返回了DirectX捕获错误HRESULT E_FAIL

C# 对COM组件的调用返回了DirectX捕获错误HRESULT E_FAIL,c#,wpf,C#,Wpf,我写了一个c#wpf项目,它正在录制音频和视频。 此项目通常在我的电脑上运行,但当我将安装程序部署到其他电脑上时,此项目不起作用。 我需要帮助 调用COM组件时返回错误HRESULT E_FAIL 28-08 10:49:16.296[错误]此处的Tenter代码estCamera.MainWindow.StartRecording-1-调用COM组件时返回错误HRESULT E_FAIL。 System.Runtime.InteropServices.COMException(0x800040

我写了一个c#wpf项目,它正在录制音频和视频。 此项目通常在我的电脑上运行,但当我将安装程序部署到其他电脑上时,此项目不起作用。 我需要帮助

调用COM组件时返回错误HRESULT E_FAIL

28-08 10:49:16.296[错误]此处的Tenter代码estCamera.MainWindow.StartRecording-1-调用COM组件时返回错误HRESULT E_FAIL。 System.Runtime.InteropServices.COMException(0x80004005):调用COM组件时返回错误HRESULT E_FAIL

 try
        {
            var filters = new Filters();
            GetDevices();
            foreach (Filter v in filters.VideoInputDevices)
            {
                foreach (Filter a in filters.AudioInputDevices)
                {
                    try
                    {
                        capture = new Capture(v, a);
                        device = true;
                        //capture.VideoCompressor = filters.VideoCompressors[0];
                        //capture.AudioCompressor = filters.AudioCompressors[0];
                        logger.Info("audio connected--" + a.Name + "--" + a.MonikerString);
                        logger.Info("video connected--" + v.Name + "--" + v.MonikerString);
                        break;
                    }
                    catch (Exception ex)
                    {
                        logger.Error(ex);
                        continue;
                    }
                }

                if (device)
                {
                    break;
                }
            }
            if (device)
            {
                capture.Stop();
                capture.Filename = GetRecordingPath(ticketId);
                capture.Start();//-----------error in there
                logger.Info("camera started");
            }
            else
            {
                MessageBox.Show("Kamera qoşulmayıb");
            }
        }
        catch (Exception ex)
        {
            logger.Error(ex, ex.Message);
        }
    }

带有代码的问题应该是。没有办法重现你的问题。通常,在一台计算机上工作而不在另一台计算机上工作的软件与另一台计算机上不存在的依赖项有关。