我有一种很好的方式来捕获未处理的异常,这些异常会显示给我的用户并(可选地)通过电子邮件发送给我自己。它们通常看起来像这样:
Uncaught exception encountered in MyApp (Version 1.1.0)!
Exception:
Object reference not set to an instance of an object.
Exception type:
System.NullReferenceException
Source:
MyApp
Stack trace:
at SomeLibrary.DoMoreStuff() in c:\projects\myapp\somelibrary.h:line 509
at SomeAlgothim.DoStuff() in c:\projects\myapp\somealgorithm.h:line 519
at MyApp.MainForm.ItemCheckedEventHandler(Object sender, ItemCheckedEventArgs e) in c:\projects\myapp\mainform.cpp:line 106
at System.Windows.Forms.ListView.OnItemChecked(ItemCheckedEventArgs e)
at System.Windows.Forms.ListView.WmReflectNotify(Message& m)
at System.Windows.Forms.ListView.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
是否可以启动视觉工作室并c:\projects\myapp\somelibrary.h
在违规线路上打开它,如果可以,如何?
如果可能的话,我还想从我生成的 (html) 电子邮件中执行此操作?