From 31e17cdaee51a69a1073ca74dafff51afdaf3842 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Mon, 29 Nov 2010 21:20:19 +0000 Subject: [PATCH] - win_tray: Add logging support to trap crashes. clienttray/ tray_win.cpp win_build/ boinctray.vcproj svn path=/branches/boinc_core_release_6_12/; revision=22759 --- checkin_notes | 8 ++++++++ clienttray/tray_win.cpp | 17 +++++++++++++++++ win_build/boinctray.vcproj | 24 ++++++++++++------------ 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/checkin_notes b/checkin_notes index 1f7eed0b47..a7bf0e15fe 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7942,3 +7942,11 @@ Charlie 18 Nov 2010 client/ hostinfo_unix.cpp + +Rom 18 Nov 2010 + - win_tray: Add logging support to trap crashes. + + clienttray/ + tray_win.cpp + win_build/ + boinctray.vcproj diff --git a/clienttray/tray_win.cpp b/clienttray/tray_win.cpp index f39a238c4a..954d905e17 100644 --- a/clienttray/tray_win.cpp +++ b/clienttray/tray_win.cpp @@ -18,6 +18,8 @@ #include "boinc_win.h" +#include "diagnostics.h" +#include "win_util.h" #include "boinc_tray.h" #include "tray_win.h" #include "idlemon.h" @@ -46,6 +48,21 @@ CBOINCTray::CBOINCTray() { // INT CBOINCTray::Run( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR /* lpCmdLine */ , int /* nCmdShow */ ) { + // Initialize the BOINC Diagnostics Framework + int flags = +#ifdef _DEBUG + BOINC_DIAG_MEMORYLEAKCHECKENABLED | +#endif + BOINC_DIAG_DUMPCALLSTACKENABLED | + BOINC_DIAG_HEAPCHECKENABLED | + BOINC_DIAG_TRACETOSTDOUT | + BOINC_DIAG_REDIRECTSTDERR | + BOINC_DIAG_REDIRECTSTDOUT; + + chdir_to_data_dir(); + diagnostics_init(flags, "stdouttray", "stderrtray"); + + // Create application window class if (!hPrevInstance) { // Register an appropriate window class for the primary window WNDCLASS cls; diff --git a/win_build/boinctray.vcproj b/win_build/boinctray.vcproj index 8d6a017e4d..3804919a1f 100644 --- a/win_build/boinctray.vcproj +++ b/win_build/boinctray.vcproj @@ -23,7 +23,7 @@ IntermediateDirectory=".\Build\$(PlatformName)\$(ConfigurationName)\$(ProjectName)\obj" ConfigurationType="1" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" - UseOfMFC="1" + UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" CharacterSet="2" > @@ -55,7 +55,7 @@ PreprocessorDefinitions="WIN32;_DEBUG;_MT;_WINDOWS;_CONSOLE" ExceptionHandling="2" BasicRuntimeChecks="3" - RuntimeLibrary="1" + RuntimeLibrary="3" BufferSecurityCheck="true" FloatingPointModel="2" UsePrecompiledHeader="2" @@ -86,7 +86,7 @@ /> @@ -165,7 +165,7 @@ PreprocessorDefinitions="WIN32;_DEBUG;_MT;_WINDOWS;_CONSOLE" ExceptionHandling="2" BasicRuntimeChecks="3" - RuntimeLibrary="1" + RuntimeLibrary="3" BufferSecurityCheck="true" FloatingPointModel="2" UsePrecompiledHeader="2" @@ -197,7 +197,7 @@ /> @@ -276,7 +276,7 @@ PreprocessorDefinitions="WIN32;NDEBUG;_MT;_WINDOWS;_CONSOLE" StringPooling="false" ExceptionHandling="2" - RuntimeLibrary="0" + RuntimeLibrary="2" EnableFunctionLevelLinking="false" FloatingPointModel="2" UsePrecompiledHeader="2" @@ -307,7 +307,7 @@ /> @@ -385,7 +385,7 @@ PreprocessorDefinitions="WIN32;NDEBUG;_MT;_WINDOWS;_CONSOLE" StringPooling="false" ExceptionHandling="2" - RuntimeLibrary="0" + RuntimeLibrary="2" EnableFunctionLevelLinking="false" FloatingPointModel="2" UsePrecompiledHeader="2" @@ -417,7 +417,7 @@ />