Index: src/ch/UpdaterDlg.cpp =================================================================== diff -u -rd0cfddc68b5ec4dc4e9b73b6f87aa97995c7cc54 -r8068e0c351055554340ac9755d1bc846893bf2b8 --- src/ch/UpdaterDlg.cpp (.../UpdaterDlg.cpp) (revision d0cfddc68b5ec4dc4e9b73b6f87aa97995c7cc54) +++ src/ch/UpdaterDlg.cpp (.../UpdaterDlg.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) @@ -10,6 +10,9 @@ #include #include #include "WindowsVersion.h" +#include "../libchcore/TLogger.h" +#include "resource.h" +#include "CfgProperties.h" #define UPDATER_TIMER 639 @@ -25,8 +28,8 @@ IMPLEMENT_DYNAMIC(CUpdaterDlg, ictranslate::CLanguageDialog) -CUpdaterDlg::CUpdaterDlg(bool bBackgroundMode, CWnd* pParent /*=NULL*/) : - ictranslate::CLanguageDialog(CUpdaterDlg::IDD, pParent), +CUpdaterDlg::CUpdaterDlg(bool bBackgroundMode, CWnd* pParent /*=nullptr*/) : + ictranslate::CLanguageDialog(IDD_UPDATER_DIALOG, pParent), m_eLastState(CUpdateChecker::eResult_Undefined), m_bBackgroundMode(bBackgroundMode) { @@ -67,7 +70,7 @@ CheckForUpdates(); // start a timer to display progress - SetTimer(UPDATER_TIMER, 50, NULL); + SetTimer(UPDATER_TIMER, 50, nullptr); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE @@ -162,7 +165,6 @@ default: _ASSERTE(FALSE); - eBkMode = eRes_Exit; return; } @@ -219,7 +221,7 @@ void CUpdaterDlg::UpdateIcon(EUpdateType eType) { - HICON hIcon = NULL; + HICON hIcon = nullptr; switch(eType) { case eIcon_Warning: @@ -366,12 +368,25 @@ } } - m_ucChecker.AsyncCheckForUpdates(strSite, - GetPropValue(GetConfig()), - (UpdateVersionInfo::EVersionType)GetPropValue(GetConfig()), - m_bBackgroundMode, - false // disabled sending headers as it is causing issues with WinInet on WinXP and Win Vista - ); + CString strError; + try + { + m_ucChecker.AsyncCheckForUpdates(strSite, + GetPropValue(GetConfig()), + (UpdateVersionInfo::EVersionType)GetPropValue(GetConfig()), + m_bBackgroundMode, + false // disabled sending headers as it is causing issues with WinInet on WinXP and Win Vista + ); + } + catch (const std::exception& e) + { + strError = e.what(); + } + + if(!strError.IsEmpty()) + { + LOG_ERROR(strError); + } } void CUpdaterDlg::EnableUpdateRelatedControls(bool bEnable)