摘要:
封装了一个C++类,当程序意外崩溃的时候可以生成dump文件,以便确定错误原因。头文件: 1 //crash_dumper_w32.h 2 3 #ifndef _CRASH_DUMPER_H_ 4 5 #define _CRASH_DUMPER_H_ 6 7 8 #include <windows.h> 9 10 class CrashDumper11 12 {13 14 public:15 16 CrashDumper();17 18 ~CrashDumper();19 20 static bool _PlaceHolder();21 22 ... 阅读全文
摘要:
在主程序初始化时加入DeclareDumpFile(); 1 创建头文件DumpFile.h, 将下列代码放进文件中 2 3 #pragma once 4 #include <windows.h> 5 #include < Dbghelp.h> 6 #include <iostream> 7 #include <vector> 8 using namespace std; 9 10 11 #pragma comment(lib, "Dbghelp.lib") 12 13 14 namespace NSDumpFile 15 { 阅读全文