我想在Delphi 2007(Win32)的错误对话框中显示堆栈跟踪。
理想情况下,我会喜欢这样的:
try //do something except on e : exception do begin //rollback a transaction or whatever i need to do here MessageDlg('An error has occurred!' + #13#10 + e.Message + #13#10 + 'Here is the stack trace:' + #13#10 + e.StackTrace,mtError,[mbOK],0); end; //except end; /try-except
并且输出像IDE中的Call Stack一样:
MYPROGRAM.SomeFunction MYPROGRAM.SomeProcedure MYPROGRAM.MYPROGRAM :7c817067 kernel32.RegisterWaitForInputIdle + 0x49