File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -142,10 +142,6 @@ class CCrashReport
142142
143143 void ShowCrashInfo (EXCEPTION_POINTERS* pEP)
144144 {
145- CMessageDlg dlg;
146- dlg.SetWindowTitle (APP_NAME);
147- dlg.SetInfoText (CCommon::LoadText (IDS_ERROR_MESSAGE));
148-
149145 CString info = CCommon::LoadTextFormat (IDS_CRASH_INFO, { m_dumpFile });
150146 info += _T (" \r\n " );
151147 // 在崩溃信息中调用堆栈
@@ -157,7 +153,16 @@ class CCrashReport
157153 info += _T (" \r\n " );
158154 }
159155 info += theApp.GetSystemInfoString ();
160- dlg.SetMessageText (info);
156+ // 写入日志
157+ CString crash_log = info;
158+ crash_log.Replace (_T (" \r\n " ), _T (" \n " ));
159+ crash_log.Replace (_T (" \n\n " ), _T (" \n " ));
160+ CCommon::WriteLog (crash_log.GetString (), theApp.m_log_path .c_str ());
161+ // 显示崩溃对话框
162+ CMessageDlg dlg;
163+ dlg.SetWindowTitle (APP_NAME);
164+ dlg.SetInfoText (CCommon::LoadText (IDS_ERROR_MESSAGE));
165+ dlg.SetMessageText (info);
161166 dlg.SetStandarnMessageIcon (CMessageDlg::SI_ERROR);
162167 dlg.DoModal ();
163168 }
You can’t perform that action at this time.
0 commit comments