【发布时间】:2014-05-30 20:40:50
【问题描述】:
我正在使用 Visual Studio 制作一个 Windows 窗体应用程序。该应用程序允许您输入您希望为照片命名的名称,然后将该图像保存到网络上的特定位置。当我在笔记本电脑上使用它时效果很好。但是,当我尝试在桌面上运行它时,它不起作用。相反,我得到了消息:
System.Runtime.InteropServices.COMException (0x80040217): 否 可以发现中间过滤器的组合使 连接。
在 DirectShowLib.DsError.ThrowExceptionForHR(Int32 hr)
在 OrderProductCapture.Capture.SetupGraph(DsDevice dev, Int32 iWidth, Int32 iHeight, Int16 iBPP, Control hControl)
在 OrderProductCapture.Capture.ctor(Int32 iDeviceNum, Int32 iWidth, Int32 iHeight, Int16 iBPP, Control hControl)
在 OrderProductCapture.frmMain.ctor()
调用堆栈说:
OrderProductCapture.exe!OrderProductCapture.Capture(int iDeviceNum, int iWidth, int iHeight, short iBPP, System.Windows.Forms.Control hControl) Line 82
OrderProductCapture.exe!OrderProductCapture.frmMain.frmMain() Line 50
OrderProductCapture.exe!OrderProductCapture.Program.Main() Line 19
我已经在谷歌上搜索过很多次,并且我已经查看了关于 SO 的大多数类似问题。两台计算机都使用 Windows 7 专业版。任何帮助都会很棒。
这是我的代码捕获异常的代码。我认为代码没有错,因为它在我的笔记本电脑上运行良好。
public Capture(int iDeviceNum, int iWidth, int iHeight, short iBPP, Control hControl)
{
DsDevice [] capDevices;
// Get the collection of video devices
capDevices = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice);
if (iDeviceNum + 1 > capDevices.Length)
{
throw new Exception("No video capture devices found at that index!");
}
try
{
// Set up the capture graph
SetupGraph( capDevices[iDeviceNum], iWidth, iHeight, iBPP, hControl);
// tell the callback to ignore new images
m_PictureReady = new ManualResetEvent(false);
}
catch
{
Dispose();
throw;
}
}
【问题讨论】:
-
异常的调用栈是什么?
-
This is the code where my code catches the exception并再次抛出它。 -
@Matt 我添加了调用堆栈信息
标签: c# directshow