关于WPF全局错误捕获的有关问题
关于WPF全局异常捕获的问题
WPF程序中出现下图所示错误:

使用wpf捕获全局异常的方式不活不到吗?
//处理未捕获的异常
//Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
//处理UI线程异常
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
//处理非UI线程异常
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
------解决思路----------------------
试试这个SetUnhandledExceptionFilter
如果还不行,就要写个c的库来调用
public delegate int UnhandledExceptionCallBack(ref long a);
[DllImport("kernel32")]
private static extern int SetUnhandledExceptionFilter(UnhandledExceptionCallBack f);
WPF程序中出现下图所示错误:
使用wpf捕获全局异常的方式不活不到吗?
//处理未捕获的异常
//Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
//处理UI线程异常
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
//处理非UI线程异常
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
------解决思路----------------------
试试这个SetUnhandledExceptionFilter
如果还不行,就要写个c的库来调用
public delegate int UnhandledExceptionCallBack(ref long a);
[DllImport("kernel32")]
private static extern int SetUnhandledExceptionFilter(UnhandledExceptionCallBack f);