老生常談:讓軟件留下臨終遺言並優雅地關閉

實際上就是調用系統函數SetUnhandledExceptionFilter設置頂層異常捕獲函數,而且利用MiniDumpWriteDump函數將異常堆棧輸出到文件中,方便問題的定位。windows 參考代碼以下:安全 #include <windows.h> #include <imagehlp.h> #include <Strsafe.h> #pragma comment(lib, "dbg
相關文章
相關標籤/搜索