我有一个WPF网络摄像头组件的源代码来自
Codeplex
我正在尝试从.NET 3.5移植到.NET 4.0。
在这两个目标下编译都很好,但在.NET 4.0版本中,当使用
System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception
在直线上
moniker.BindToObject(bindCtx, null, ref filterId, out filterObject);
在这种方法中:
internal static IBaseFilter CreateFilter(string filterMoniker)
{
object filterObject = null;
IBindCtx bindCtx = null;
IMoniker moniker = null;
int n = 0;
if (CreateBindCtx(0, out bindCtx) == 0)
{
if (MkParseDisplayName(bindCtx, filterMoniker, ref n, out moniker) == 0)
{
Guid filterId = typeof(IBaseFilter).GUID;
try
{
moniker.BindToObject(bindCtx, null, ref filterId, out filterObject);
}
catch (Exception ex)
{
MessageBox.Show(ex+"");
}
Marshal.ReleaseComObject(moniker);
}
Marshal.ReleaseComObject(bindCtx);
}
return filterObject as IBaseFilter;
}
知道为什么以及如何修复它吗?
相机是
Genius Eye 110
,我正在Windows XP SP2下工作。