Connecting Tech Pros Worldwide Forums | Help | Site Map

Again Winforms Unhandled Exceptions

Newbie
 
Join Date: Aug 2007
Posts: 9
#1: Oct 15 '08
Good day.
I have code which must handle global exceptions.
But it doesn't handle permission exception or exception when neccessary DLL no t found. Windows show message with little information and button "Send Report". And I need to know what error occured. What i did wrong?

Expand|Select|Wrap|Line Numbers
  1.         [STAThread]
  2.         static void Main()
  3.         {
  4.             AppDomain l_domain = AppDomain.CurrentDomain;
  5.             l_domain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
  6.             Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
  7.             Application.EnableVisualStyles();
  8.             Application.SetCompatibleTextRenderingDefault(false);
  9.  
  10.             Application.Run(new frmMain());
  11.         }

Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#2: Oct 16 '08

re: Again Winforms Unhandled Exceptions


I don't think you CAN catch those exceptions. I've not seen any way to do it.
Reply