Index: src/ch/AppHelper.cpp =================================================================== diff -u -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 -r50830b27409540a4b2c97b40cfbf86b78dd02327 --- src/ch/AppHelper.cpp (.../AppHelper.cpp) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) +++ src/ch/AppHelper.cpp (.../AppHelper.cpp) (revision 50830b27409540a4b2c97b40cfbf86b78dd02327) @@ -151,7 +151,7 @@ if (_tcsnicmp(pszString, _T(""), 9) == 0) { // get windows path - _tcscpy(szStr, m_pszProgramPath); + _tcscpy(szStr, m_pszProgramPath ? m_pszProgramPath : _t("")); _tcscat(szStr, pszString+9); } else if (_tcsnicmp(pszString, _T(""), 9) == 0) Index: src/ch/FileInfo.cpp =================================================================== diff -u -r336bb030d9b4bff561ff100563725213ed6703c9 -r50830b27409540a4b2c97b40cfbf86b78dd02327 --- src/ch/FileInfo.cpp (.../FileInfo.cpp) (revision 336bb030d9b4bff561ff100563725213ed6703c9) +++ src/ch/FileInfo.cpp (.../FileInfo.cpp) (revision 50830b27409540a4b2c97b40cfbf86b78dd02327) @@ -30,6 +30,8 @@ #include "Device IO.h" #include "imagehlp.h" #include "ch.h" +#include +#include "../libicpf/exception.h" #ifdef _DEBUG #undef THIS_FILE @@ -695,7 +697,9 @@ void CFileInfo::Create(const WIN32_FIND_DATA* pwfd, LPCTSTR pszFilePath, int iSrcIndex) { - ASSERT(m_pClipboard); + BOOST_ASSERT(m_pClipboard); + if(!m_pClipboard) + THROW(_t("Internal error: pointer not initialized."), 0, 0, 0); // copy data from W32_F_D m_strFilePath = CString(pszFilePath) + pwfd->cFileName; Index: src/ch/MainWnd.cpp =================================================================== diff -u -rd9982d1ee462dceb76298ef4216f0b6122d004a6 -r50830b27409540a4b2c97b40cfbf86b78dd02327 --- src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision d9982d1ee462dceb76298ef4216f0b6122d004a6) +++ src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 50830b27409540a4b2c97b40cfbf86b78dd02327) @@ -50,6 +50,7 @@ #include "af_defs.h" #include "UpdateChecker.h" #include "UpdaterDlg.h" +#include #ifdef _DEBUG #define new DEBUG_NEW @@ -252,15 +253,15 @@ if (!fi.Create(pTask->GetClipboardData(i)->GetPath(), i)) { // log - ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_OTFMISSINGCLIPBOARDINPUT_STRING)); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFMISSINGCLIPBOARDINPUT_STRING)); fmt.SetParam(_t("%path"), pTask->GetClipboardData(i)->GetPath()); pTask->m_log.logw(fmt); continue; } else { // log - ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_OTFADDINGCLIPBOARDFILE_STRING)); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFADDINGCLIPBOARDFILE_STRING)); fmt.SetParam(_t("%path"), pTask->GetClipboardData(i)->GetPath()); pTask->m_log.logi(fmt); } @@ -288,7 +289,7 @@ pTask->FilesAdd(fi); // log - ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_OTFADDEDFOLDER_STRING)); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFADDEDFOLDER_STRING)); fmt.SetParam(_t("%path"), fi.GetFullFilePath()); pTask->m_log.logi(fmt); } @@ -298,7 +299,7 @@ || iDestDrvNumber != fi.GetDriveNumber() || CFileInfo::Exist(fi.GetDestinationPath(pTask->GetDestPath().GetPath(), 0, ((int)bForceDirectories) << 1)) ) { // log - ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_OTFRECURSINGFOLDER_STRING)); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFRECURSINGFOLDER_STRING)); fmt.SetParam(_t("%path"), fi.GetFullFilePath()); pTask->m_log.logi(fmt); @@ -1288,7 +1289,6 @@ if (e->m_iType == E_ERROR && GetConfig()->get_bool(PP_SNDPLAYSOUNDS)) { - szPath[_MAX_PATH]; GetConfig()->get_string(PP_SNDERRORSOUNDPATH, szPath, _MAX_PATH); GetApp()->ExpandPath(szPath); PlaySound(szPath, NULL, SND_FILENAME | SND_ASYNC); @@ -1319,7 +1319,7 @@ // bufor TCHAR path[_MAX_PATH]; - UINT i; // counter +// UINT i; // counter CTask *pTask; // ptr to a task CClipboardEntry* pEntry=NULL; @@ -1329,13 +1329,14 @@ LONG lFinished=0; bool bEnd=false; + icpf::config* pConfig = GetConfig(); + BOOST_ASSERT(pConfig); + if(!pConfig) + return -1; while (!pData->bKill) { - if (uiCounter == 0 && GetConfig()->get_bool(PP_PCLIPBOARDMONITORING) && IsClipboardFormatAvailable(CF_HDROP)) + if (uiCounter == 0 && pConfig->get_bool(PP_PCLIPBOARDMONITORING) && IsClipboardFormatAvailable(CF_HDROP)) { - icpf::config* pConfig = GetConfig(); - assert(pConfig); - // get data from clipboard OpenClipboard(pData->m_hwnd); HANDLE handle=GetClipboardData(CF_HDROP); @@ -1344,7 +1345,7 @@ pTask=new CTask(&pData->m_pTasks->m_tcd); - for (i=0;i(handle), i, path, _MAX_PATH); pEntry=new CClipboardEntry; @@ -1354,7 +1355,7 @@ if (IsClipboardFormatAvailable(nFormat)) { - HANDLE handle=GetClipboardData(nFormat); + handle=GetClipboardData(nFormat); LPVOID addr=GlobalLock(handle); DWORD dwData=((DWORD*)addr)[0];