Codeplex의 WPF 웹캠 구성 요소의 소스 코드가 .NET 3.5에서 .NET 4.0으로 포팅하려고합니다..NET 4.0에서 WPF 웹캠 구성 요소가 충돌합니다.
은 모두 대상에서 잘 컴파일,하지만이 방법의 라인 moniker.BindToObject(bindCtx, null, ref filterId, out filterObject);
에서 System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception
와 응용 프로그램을 실행할 때 .NET 4.0 버전에서, 그것은 충돌 : 어떻게 해결하는 이유와
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에서 작업하고 있습니다.
당신은 당신의 app.config <시작 useLegacyV2RuntimeActivationPolicy = "진정한"> 문자열에 추가하려고 했습니까? –
@Eugene Cheverda app.config에서이 내용을 추가하려고했지만 아직 변경된 사항이 없습니다. 예외가 계속 발생합니다. – luvieere