Hi,
I'm using NetAdvantage for Winform 12.1 for .NET 4, and now I'm working with UltraToolbarManager.
Our team designed our application to handle all handled exception at AppDomain.UnhandledException Handler, to deal with error log at one location.
So use Application.SetUnhandledExceptionMode and handle all exceptions like following code;
AppDomain.CurrentDomain.UnhandledException += (sender, args) => { var ex = args.ExceptionObject as Exception; MessageBox.Show("Nice Catch in Unhandled Exception!\n" + ex.Message); }; Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);
Everything goes fine, except UltraToolbarManager...
When click menus, it's OK. Unhandled Exception occurs.However, if I click toolbar button, ThreadException occurs and ,that's all. No UnhandledException fired.
Is it design ? Are there any ways to change this behavior ?
Sorry for late replay.
OK, we will receive this behavior, but we have to write many try&catch... :(
Hello,
I am just checking about the progress of this issue. Let me know If you need my further assistance on this issue?
Thank you for using Infragistics Components
Hello ,
Thank you for the provide sample. I have consulted with our developers regarding your issue, and the reason for this is because we do use NativeWindows. We use the NativeWindow class to subclass controls, allowing us to override WndProc() and route messages accordingly. The NativeWindow class will route an unhandled exception that occurs in its message handling (WM_LBUTTONUP) to the ThreadException handler. So this is expected behavior.
Please let me know if you have any further questions.
Hi, Chipilev
Sorry for my late reply.
I attached sample application to this post.It's windowsform application set unhandleExceptionMode = ThrowException (see Program.cs)
By this option, Every exception which isn't caught in application code will be handled at AppDomain.UnhandledException.So when you click button(which always throws exception), the exception is handled at UnhandledException, and application is terminated.And when you click menu (which always throws exception similarly), you can see same behavior.
But, when you click toolbar (which use same tools in menu), the behavior is difference. Exception is handled at Application.ThreadException.
Is it a right behavior ?
Hello Hiroshi,
I am still following your thread. Did my suggestions helped you to solve your issue ? If not please do not hesitate to contact us if you still have any other questions related with this matter.