Index: src/ch/UpdaterDlg.cpp =================================================================== diff -u -r8068e0c351055554340ac9755d1bc846893bf2b8 -rb26ced3298e3e7e51d91f3ac70b56746786da83b --- src/ch/UpdaterDlg.cpp (.../UpdaterDlg.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) +++ src/ch/UpdaterDlg.cpp (.../UpdaterDlg.cpp) (revision b26ced3298e3e7e51d91f3ac70b56746786da83b) @@ -10,9 +10,9 @@ #include #include #include "WindowsVersion.h" -#include "../libchcore/TLogger.h" #include "resource.h" #include "CfgProperties.h" +#include "../liblogger/TLogger.h" #define UPDATER_TIMER 639 @@ -23,15 +23,14 @@ ON_WM_TIMER() END_MESSAGE_MAP() - // CUpdaterDlg dialog - IMPLEMENT_DYNAMIC(CUpdaterDlg, ictranslate::CLanguageDialog) CUpdaterDlg::CUpdaterDlg(bool bBackgroundMode, CWnd* pParent /*=nullptr*/) : ictranslate::CLanguageDialog(IDD_UPDATER_DIALOG, pParent), m_eLastState(CUpdateChecker::eResult_Undefined), - m_bBackgroundMode(bBackgroundMode) + m_bBackgroundMode(bBackgroundMode), + m_spLog(logger::MakeLogger(GetLogFileData(), L"UpdaterDlg")) { RegisterStaticExControl(AfxGetInstanceHandle()); } @@ -56,6 +55,10 @@ { ictranslate::CLanguageDialog::OnInitDialog(); + // set dialog icon + HICON hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); + SetIcon(hIcon, FALSE); + InitRichEdit(); InitUpdateFreqCombo(); InitUpdateChannelCombo(); @@ -83,13 +86,13 @@ { CString str; str.Format(_T("Opening a browser with address %s..."), (PCTSTR)strDownloadAddr); - LOG_DEBUG(str); + LOG_DEBUG(m_spLog) << str; str.Format(_T("url.dll,FileProtocolHandler %s"), (PCTSTR)strDownloadAddr); ULONG_PTR ulRes = (ULONG_PTR)ShellExecute(nullptr, _T("open"), _T("rundll32.exe"), str, nullptr, SW_SHOW); str.Format(_T("ShellExecute returned %I64u"), (unsigned long long)ulRes); - LOG_DEBUG(str); + LOG_DEBUG(m_spLog) << str; // close the dialog if succeeded; 32 is some arbitrary value from ms docs if(ulRes > 32) @@ -176,7 +179,7 @@ fmt.SetParam(_T("%officialver"), m_ucChecker.GetReadableVersion()); fmt.SetParam(L"%reldate", m_ucChecker.GetReleaseDate()); - CString strEntireText = fmt; + CString strEntireText = (PCTSTR)fmt; CString strReleaseNotes = m_ucChecker.GetReleaseNotes(); strReleaseNotes = strReleaseNotes.Trim(); if(!strReleaseNotes.IsEmpty()) @@ -385,7 +388,7 @@ if(!strError.IsEmpty()) { - LOG_ERROR(strError); + LOG_ERROR(m_spLog) << strError; } }