From f855ab81f6460a54b7669ae18509f96f2b7fc777 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Thu, 18 Nov 2010 15:35:43 +0000 Subject: [PATCH] - win_tray: Add logging support to trap crashes. clienttray/ tray_win.cpp win_build/ boinctray.vcproj svn path=/trunk/boinc/; revision=22709 --- 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 6fe2bbd5f2..395275fed0 100644 --- a/checkin_notes +++ b/checkin_notes @@ -8163,3 +8163,11 @@ Charlie 18 Nov 2010 mac_installer/ release_boinc.sh + +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 @@ />