J'ai un code source de composant de webcam WPF de Codeplex que j'essaye de porter de .NET 3.5 à .NET 4.0.Le composant Webcam WPF se bloque sous .NET 4.0
Compile très bien dans les deux cibles, mais dans la version .NET 4.0, il se bloque lors de l'exécution de l'application avec un System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception
à la ligne moniker.BindToObject(bindCtx, null, ref filterId, out filterObject);
dans cette méthode:
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;
}
Toute idée pourquoi et comment fixer il?
L'appareil photo est un Genius Eye 110 et je travaille sous Windows XP SP2.
Avez-vous essayé d'ajouter à votre app.config string? –
@Eugene Cheverda J'ai juste essayé d'ajouter ceci dans app.config, mais rien n'a changé: je reçois toujours l'exception. – luvieere