Index: src/ch/AboutDlg.cpp =================================================================== diff -u -N -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 -r336bb030d9b4bff561ff100563725213ed6703c9 --- src/ch/AboutDlg.cpp (.../AboutDlg.cpp) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) +++ src/ch/AboutDlg.cpp (.../AboutDlg.cpp) (revision 336bb030d9b4bff561ff100563725213ed6703c9) @@ -54,11 +54,11 @@ return; else { - TCHAR szFull[256]; - _sntprintf(szFull, 256, GetResManager()->LoadString(IDS_ABOUTVERSION_STRING), GetApp()->GetAppVersion()); + CString strText = GetResManager()->LoadString(IDS_ABOUTVERSION_STRING); + strText += GetApp()->GetAppVersion(); pCtl->SetWindowText(GetApp()->GetAppNameVer()); - pCtl2->SetWindowText(szFull); + pCtl2->SetWindowText(strText); pWndCopyright->SetWindowText(_T(COPYRIGHT_INFO)); } } Index: src/ch/CustomCopyDlg.cpp =================================================================== diff -u -N -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 -r336bb030d9b4bff561ff100563725213ed6703c9 --- src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) +++ src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision 336bb030d9b4bff561ff100563725213ed6703c9) @@ -463,24 +463,30 @@ m_ctlBufferSizes.ResetContent(); // fill the list - TCHAR szData[160], szSize[64]; + TCHAR szSize[64]; + ictranslate::CFormat fmt; + + fmt.SetFormat(GetResManager()->LoadString(IDS_BSEDEFAULT_STRING)); + fmt.SetParam(_t("%size"), GetSizeString(m_ccData.m_bsSizes.m_uiDefaultSize, szSize, 64, true)); + m_ctlBufferSizes.AddString(fmt); - _sntprintf(szData, 160, GetResManager()->LoadString(IDS_BSEDEFAULT_STRING), GetSizeString(m_ccData.m_bsSizes.m_uiDefaultSize, szSize, 64, true)); - m_ctlBufferSizes.AddString(szData); - if (!m_ccData.m_bsSizes.m_bOnlyDefault) { - _sntprintf(szData, 160, GetResManager()->LoadString(IDS_BSEONEDISK_STRING), GetSizeString(m_ccData.m_bsSizes.m_uiOneDiskSize, szSize, 64, true)); - m_ctlBufferSizes.AddString(szData); + fmt.SetFormat(GetResManager()->LoadString(IDS_BSEONEDISK_STRING)); + fmt.SetParam(_t("%size"), GetSizeString(m_ccData.m_bsSizes.m_uiOneDiskSize, szSize, 64, true)); + m_ctlBufferSizes.AddString(fmt); - _sntprintf(szData, 160, GetResManager()->LoadString(IDS_BSETWODISKS_STRING), GetSizeString(m_ccData.m_bsSizes.m_uiTwoDisksSize, szSize, 64, true)); - m_ctlBufferSizes.AddString(szData); + fmt.SetFormat(GetResManager()->LoadString(IDS_BSETWODISKS_STRING)); + fmt.SetParam(_t("%size"), GetSizeString(m_ccData.m_bsSizes.m_uiTwoDisksSize, szSize, 64, true)); + m_ctlBufferSizes.AddString(fmt); - _sntprintf(szData, 160, GetResManager()->LoadString(IDS_BSECD_STRING), GetSizeString(m_ccData.m_bsSizes.m_uiCDSize, szSize, 64, true)); - m_ctlBufferSizes.AddString(szData); + fmt.SetFormat(GetResManager()->LoadString(IDS_BSECD_STRING)); + fmt.SetParam(_t("%size"), GetSizeString(m_ccData.m_bsSizes.m_uiCDSize, szSize, 64, true)); + m_ctlBufferSizes.AddString(fmt); - _sntprintf(szData, 160, GetResManager()->LoadString(IDS_BSELAN_STRING), GetSizeString(m_ccData.m_bsSizes.m_uiLANSize, szSize, 64, true)); - m_ctlBufferSizes.AddString(szData); + fmt.SetFormat(GetResManager()->LoadString(IDS_BSELAN_STRING)); + fmt.SetParam(_t("%size"), GetSizeString(m_ccData.m_bsSizes.m_uiLANSize, szSize, 64, true)); + m_ctlBufferSizes.AddString(fmt); } } @@ -890,9 +896,9 @@ } // report - CString strFmt; - strFmt.Format(GetResManager()->LoadString(IDS_IMPORTREPORT_STRING), uiCount); - AfxMessageBox(strFmt); + ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_IMPORTREPORT_STRING)); + fmt.SetParam(_t("%count"), uiCount); + AfxMessageBox(fmt); } } Index: src/ch/FileInfo.cpp =================================================================== diff -u -N -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 -r336bb030d9b4bff561ff100563725213ed6703c9 --- src/ch/FileInfo.cpp (.../FileInfo.cpp) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) +++ src/ch/FileInfo.cpp (.../FileInfo.cpp) (revision 336bb030d9b4bff561ff100563725213ed6703c9) @@ -59,14 +59,22 @@ // set the dest path CString strCheckPath; - strCheckPath.Format(GetResManager()->LoadString(IDS_FIRSTCOPY_STRING), strFolderName); + ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_FIRSTCOPY_STRING)); + fmt.SetParam(_t("%name"), strFolderName); + strCheckPath = fmt; if (strCheckPath.GetLength() > _MAX_PATH) strCheckPath=strCheckPath.Left(_MAX_PATH); // max - 260 chars // when adding to strDstPath check if the path already exists - if so - try again int iCounter=1; + CString strFmt = GetResManager()->LoadString(IDS_NEXTCOPY_STRING); while (CFileInfo::Exist(strDstPath+strCheckPath)) - strCheckPath.Format(GetResManager()->LoadString(IDS_NEXTCOPY_STRING), ++iCounter, strFolderName); + { + fmt.SetFormat(strFmt); + fmt.SetParam(_t("%name"), strFolderName); + fmt.SetParam(_t("%count"), ++iCounter); + strCheckPath = fmt; + } *pstrResult=strCheckPath; } Index: src/ch/MainWnd.cpp =================================================================== diff -u -N -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 -r336bb030d9b4bff561ff100563725213ed6703c9 --- src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) +++ src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 336bb030d9b4bff561ff100563725213ed6703c9) @@ -242,19 +242,24 @@ fi.SetClipboard(pTask->GetClipboard()); // add everything + ictranslate::CFormat fmt; for (int i=0;iGetClipboardData(i)->GetPath(), i)) { // log - pTask->m_log.logw(GetResManager()->LoadString(IDS_OTFMISSINGCLIPBOARDINPUT_STRING), (PCTSTR)pTask->GetClipboardData(i)->GetPath()); + ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_OTFMISSINGCLIPBOARDINPUT_STRING)); + fmt.SetParam(_t("%path"), pTask->GetClipboardData(i)->GetPath()); + pTask->m_log.logw(fmt); continue; } else { // log - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFADDINGCLIPBOARDFILE_STRING), (PCTSTR)pTask->GetClipboardData(i)->GetPath()); + ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_OTFADDINGCLIPBOARDFILE_STRING)); + fmt.SetParam(_t("%path"), pTask->GetClipboardData(i)->GetPath()); + pTask->m_log.logi(fmt); } // found file/folder - check if the dest name has been generated @@ -280,15 +285,19 @@ pTask->FilesAdd(fi); // log - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFADDEDFOLDER_STRING), (PCTSTR)fi.GetFullFilePath()); + ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_OTFADDEDFOLDER_STRING)); + fmt.SetParam(_t("%path"), fi.GetFullFilePath()); + pTask->m_log.logi(fmt); } // don't add folder contents when moving inside one disk boundary if (bIgnoreDirs || !bMove || pTask->GetCopies() > 1 || iDestDrvNumber == -1 || iDestDrvNumber != fi.GetDriveNumber() || CFileInfo::Exist(fi.GetDestinationPath(pTask->GetDestPath().GetPath(), 0, ((int)bForceDirectories) << 1)) ) { // log - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFRECURSINGFOLDER_STRING), (PCTSTR)fi.GetFullFilePath()); + ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_OTFRECURSINGFOLDER_STRING)); + fmt.SetParam(_t("%path"), fi.GetFullFilePath()); + pTask->m_log.logi(fmt); // no movefile possibility - use CustomCopyFile pTask->GetClipboardData(i)->SetMove(false); @@ -319,7 +328,9 @@ pTask->FilesAdd(fi); // file - add // log - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFADDEDFILE_STRING), (PCTSTR)fi.GetFullFilePath()); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFADDEDFILE_STRING)); + fmt.SetParam(_t("%path"), fi.GetFullFilePath()); + pTask->m_log.logi(fmt); } } @@ -352,6 +363,7 @@ // current processed path BOOL bSuccess; CFileInfo fi; + ictranslate::CFormat fmt; // index points to 0 or next item to process for (int i=pTask->GetCurrentIndex();iFilesGetSize();i++) @@ -392,8 +404,11 @@ if (!bSuccess && dwLastError != ERROR_PATH_NOT_FOUND && dwLastError != ERROR_FILE_NOT_FOUND) { // log - pTask->m_log.logerr(GetResManager()->LoadString(IDS_OTFDELETINGERROR_STRING), dwLastError, (PCTSTR)fi.GetFullFilePath()); - throw new CProcessingException(E_ERROR, pTask, IDS_CPEDELETINGERROR_STRING, dwLastError, fi.GetFullFilePath()); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFDELETINGERROR_STRING)); + fmt.SetParam(_t("%errno"), dwLastError); + fmt.SetParam(_t("%path"), fi.GetFullFilePath()); + pTask->m_log.loge(TSTRFMT, fmt); + throw new CProcessingException(E_ERROR, pTask, dwLastError, fmt); } }//for @@ -410,6 +425,7 @@ void CustomCopyFile(PCUSTOM_COPY_PARAMS pData) { HANDLE hSrc=INVALID_HANDLE_VALUE, hDst=INVALID_HANDLE_VALUE; + ictranslate::CFormat fmt; try { // do we copy rest or recopy ? @@ -538,7 +554,11 @@ case IDCANCEL: // log if (GetConfig()->get_bool(PP_CMCREATELOG)) - pData->pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFPRECHECKCANCELREQUEST_STRING), (PCTSTR)pData->pfiSrcFile->GetFullFilePath()); + { + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFPRECHECKCANCELREQUEST_STRING)); + fmt.SetParam(_t("%path"), pData->pfiSrcFile->GetFullFilePath()); + pData->pTask->m_log.logi(fmt); + } throw new CProcessingException(E_CANCEL, pData->pTask); break; case ID_RECOPYALL: @@ -573,8 +593,11 @@ if (uiNotificationType < 1) { // log - pData->pTask->m_log.logerr(GetResManager()->LoadString(IDS_OTFOPENINGERROR_STRING), dwLastError, (PCTSTR)pData->pfiSrcFile->GetFullFilePath()); - throw new CProcessingException(E_ERROR, pData->pTask, IDS_CPEOPENINGERROR_STRING, dwLastError, pData->pfiSrcFile->GetFullFilePath()); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFOPENINGERROR_STRING)); + fmt.SetParam(_t("%errno"), dwLastError); + fmt.SetParam(_t("%path"), pData->pfiSrcFile->GetFullFilePath()); + pData->pTask->m_log.loge(TSTRFMT, fmt); + throw new CProcessingException(E_ERROR, pData->pTask, dwLastError, fmt); } else { @@ -611,17 +634,26 @@ break; case IDCANCEL: // log - pData->pTask->m_log.logerr(GetResManager()->LoadString(IDS_OTFOPENINGCANCELREQUEST_STRING), dwLastError, pData->pfiSrcFile->GetFullFilePath()); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFOPENINGCANCELREQUEST_STRING)); + fmt.SetParam(_t("%errno"), dwLastError); + fmt.SetParam(_t("%path"), pData->pfiSrcFile->GetFullFilePath()); + pData->pTask->m_log.loge(TSTRFMT, fmt); throw new CProcessingException(E_CANCEL, pData->pTask); break; case ID_WAIT: // log - pData->pTask->m_log.logerr(GetResManager()->LoadString(IDS_OTFOPENINGWAITREQUEST_STRING), dwLastError, pData->pfiSrcFile->GetFullFilePath()); - throw new CProcessingException(E_ERROR, pData->pTask, IDS_CPEOPENINGERROR_STRING, dwLastError, pData->pfiSrcFile->GetFullFilePath()); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFOPENINGWAITREQUEST_STRING)); + fmt.SetParam(_t("%errno"), dwLastError); + fmt.SetParam(_t("%path"), pData->pfiSrcFile->GetFullFilePath()); + pData->pTask->m_log.loge(TSTRFMT, fmt); + throw new CProcessingException(E_ERROR, pData->pTask, dwLastError, fmt); break; case ID_RETRY: // log - pData->pTask->m_log.logerr(GetResManager()->LoadString(IDS_OTFOPENINGRETRY_STRING), dwLastError, pData->pfiSrcFile->GetFullFilePath()); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFOPENINGRETRY_STRING)); + fmt.SetParam(_t("%errno"), dwLastError); + fmt.SetParam(_t("%path"), pData->pfiSrcFile->GetFullFilePath()); + pData->pTask->m_log.loge(TSTRFMT, fmt); goto l_openingsrc; break; } @@ -637,8 +669,11 @@ if (uiNotificationType < 1) { // log - pData->pTask->m_log.logerr(GetResManager()->LoadString(IDS_OTFDESTOPENINGERROR_STRING), dwLastError, pData->strDstFile); - throw new CProcessingException(E_ERROR, pData->pTask, IDS_CPEDESTOPENINGERROR_STRING, dwLastError, pData->strDstFile); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFDESTOPENINGERROR_STRING)); + fmt.SetParam(_t("%errno"), dwLastError); + fmt.SetParam(_t("%path"), pData->strDstFile); + pData->pTask->m_log.loge(TSTRFMT, fmt); + throw new CProcessingException(E_ERROR, pData->pTask, dwLastError, fmt); } else { @@ -665,12 +700,18 @@ SetFileAttributes(pData->strDstFile, FILE_ATTRIBUTE_NORMAL); // log - pData->pTask->m_log.logerr(GetResManager()->LoadString(IDS_OTFDESTOPENINGRETRY_STRING), dwLastError, pData->strDstFile); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFDESTOPENINGRETRY_STRING)); + fmt.SetParam(_t("%errno"), dwLastError); + fmt.SetParam(_t("%path"), pData->strDstFile); + pData->pTask->m_log.loge(TSTRFMT, fmt); goto l_openingdst; break; case IDCANCEL: // log - pData->pTask->m_log.logerr(GetResManager()->LoadString(IDS_OTFDESTOPENINGCANCELREQUEST_STRING), dwLastError, pData->strDstFile); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFDESTOPENINGCANCELREQUEST_STRING)); + fmt.SetParam(_t("%errno"), dwLastError); + fmt.SetParam(_t("%path"), pData->strDstFile); + pData->pTask->m_log.loge(TSTRFMT, fmt); throw new CProcessingException(E_CANCEL, pData->pTask); break; case ID_IGNOREALL: @@ -683,8 +724,11 @@ break; case ID_WAIT: // log - pData->pTask->m_log.logerr(GetResManager()->LoadString(IDS_OTFDESTOPENINGWAITREQUEST_STRING), dwLastError, pData->strDstFile); - throw new CProcessingException(E_ERROR, pData->pTask, IDS_CPEDESTOPENINGERROR_STRING, dwLastError, pData->strDstFile); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFDESTOPENINGWAITREQUEST_STRING)); + fmt.SetParam(_t("%errno"), dwLastError); + fmt.SetParam(_t("%path"), pData->strDstFile); + pData->pTask->m_log.loge(TSTRFMT, fmt); + throw new CProcessingException(E_ERROR, pData->pTask, dwLastError, fmt); break; } } @@ -703,15 +747,24 @@ if (SetFilePointer64(hSrc, ullMove, FILE_BEGIN) == -1 || SetFilePointer64(hDst, ullMove, FILE_BEGIN) == -1) { // log - pData->pTask->m_log.logerr(GetResManager()->LoadString(IDS_OTFMOVINGPOINTERSERROR_STRING), GetLastError(), pData->pfiSrcFile->GetFullFilePath(), pData->strDstFile, ullMove); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFMOVINGPOINTERSERROR_STRING)); + fmt.SetParam(_t("%errno"), GetLastError()); + fmt.SetParam(_t("%srcpath"), pData->pfiSrcFile->GetFullFilePath()); + fmt.SetParam(_t("%dstpath"), pData->strDstFile); + fmt.SetParam(_t("%pos"), ullMove); + pData->pTask->m_log.loge(TSTRFMT, fmt); // seek failed - seek to begin if (SetFilePointer64(hSrc, 0, FILE_BEGIN) == -1 || SetFilePointer64(hDst, 0, FILE_BEGIN) == -1) { // log dwLastError=GetLastError(); - pData->pTask->m_log.logerr(GetResManager()->LoadString(IDS_OTFRESTORINGPOINTERSERROR_STRING), dwLastError, pData->pfiSrcFile->GetFullFilePath(), pData->strDstFile); - throw new CProcessingException(E_ERROR, pData->pTask, IDS_CPERESTORINGPOINTERSERROR_STRING, dwLastError, pData->pfiSrcFile->GetFullFilePath(), pData->strDstFile); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFRESTORINGPOINTERSERROR_STRING)); + fmt.SetParam(_t("%errno"), dwLastError); + fmt.SetParam(_t("%srcpath"), pData->pfiSrcFile->GetFullFilePath()); + fmt.SetParam(_t("%dstpath"), pData->strDstFile); + pData->pTask->m_log.loge(TSTRFMT, fmt); + throw new CProcessingException(E_ERROR, pData->pTask, dwLastError, fmt); } else { @@ -739,8 +792,11 @@ { // log dwLastError=GetLastError(); - pData->pTask->m_log.logerr(GetResManager()->LoadString(IDS_OTFSETTINGZEROSIZEERROR_STRING), dwLastError, pData->strDstFile); - throw new CProcessingException(E_ERROR, pData->pTask, IDS_CPESETTINGZEROSIZEERROR_STRING, dwLastError, pData->strDstFile); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFSETTINGZEROSIZEERROR_STRING)); + fmt.SetParam(_t("%errno"), dwLastError); + fmt.SetParam(_t("%path"), pData->strDstFile); + pData->pTask->m_log.loge(TSTRFMT, fmt); + throw new CProcessingException(E_ERROR, pData->pTask, dwLastError, fmt); } // copying @@ -752,7 +808,10 @@ if (pData->pTask->GetKillFlag()) { // log - pData->pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFCOPYINGKILLREQUEST_STRING), pData->pfiSrcFile->GetFullFilePath(), pData->strDstFile); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFCOPYINGKILLREQUEST_STRING)); + fmt.SetParam(_t("%srcpath"), pData->pfiSrcFile->GetFullFilePath()); + fmt.SetParam(_t("%dstpath"), pData->strDstFile); + pData->pTask->m_log.logi(fmt); throw new CProcessingException(E_KILL_REQUEST, pData->pTask); } @@ -762,10 +821,22 @@ // log const BUFFERSIZES *pbs1=pData->dbBuffer.GetSizes(), *pbs2=pData->pTask->GetBufferSizes(); - pData->pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFCHANGINGBUFFERSIZE_STRING), - pbs1->m_uiDefaultSize, pbs1->m_uiOneDiskSize, pbs1->m_uiTwoDisksSize, pbs1->m_uiCDSize, pbs1->m_uiLANSize, - pbs2->m_uiDefaultSize, pbs2->m_uiOneDiskSize, pbs2->m_uiTwoDisksSize, pbs2->m_uiCDSize, pbs2->m_uiLANSize, - pData->pfiSrcFile->GetFullFilePath(), pData->strDstFile); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFCHANGINGBUFFERSIZE_STRING)); + + fmt.SetParam(_t("%defsize"), pbs1->m_uiDefaultSize); + fmt.SetParam(_t("%onesize"), pbs1->m_uiOneDiskSize); + fmt.SetParam(_t("%twosize"), pbs1->m_uiTwoDisksSize); + fmt.SetParam(_t("%cdsize"), pbs1->m_uiCDSize); + fmt.SetParam(_t("%lansize"), pbs1->m_uiLANSize); + fmt.SetParam(_t("%defsize2"), pbs2->m_uiDefaultSize); + fmt.SetParam(_t("%onesize2"), pbs2->m_uiOneDiskSize); + fmt.SetParam(_t("%twosize2"), pbs2->m_uiTwoDisksSize); + fmt.SetParam(_t("%cdsize2"), pbs2->m_uiCDSize); + fmt.SetParam(_t("%lansize2"), pbs2->m_uiLANSize); + fmt.SetParam(_t("%srcpath"), pData->pfiSrcFile->GetFullFilePath()); + fmt.SetParam(_t("%dstpath"), pData->strDstFile); + + pData->pTask->m_log.logi(fmt); pData->pTask->SetBufferSizes(pData->dbBuffer.Create(pData->pTask->GetBufferSizes())); } @@ -778,8 +849,12 @@ { // log dwLastError=GetLastError(); - pData->pTask->m_log.logerr(GetResManager()->LoadString(IDS_OTFREADINGERROR_STRING), dwLastError, tord, pData->pfiSrcFile->GetFullFilePath()); - throw new CProcessingException(E_ERROR, pData->pTask, IDS_CPEREADINGERROR_STRING, dwLastError, tord, pData->pfiSrcFile->GetFullFilePath()); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFREADINGERROR_STRING)); + fmt.SetParam(_t("%errno"), dwLastError); + fmt.SetParam(_t("%count"), tord); + fmt.SetParam(_t("%path"), pData->pfiSrcFile->GetFullFilePath()); + pData->pTask->m_log.loge(TSTRFMT, fmt); + throw new CProcessingException(E_ERROR, pData->pTask, dwLastError, fmt); } // change count of stored data @@ -802,8 +877,12 @@ { // log dwLastError=GetLastError(); - pData->pTask->m_log.logerr(GetResManager()->LoadString(IDS_OTFWRITINGERROR_STRING), dwLastError, rd, pData->strDstFile); - throw new CProcessingException(E_ERROR, pData->pTask, IDS_CPEWRITINGERROR_STRING, dwLastError, rd, pData->strDstFile); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFWRITINGERROR_STRING)); + fmt.SetParam(_t("%errno"), dwLastError); + fmt.SetParam(_t("%count"), rd); + fmt.SetParam(_t("%path"), pData->strDstFile); + pData->pTask->m_log.loge(TSTRFMT, fmt); + throw new CProcessingException(E_ERROR, pData->pTask, dwLastError, fmt); } // increase count of processed data @@ -829,7 +908,10 @@ catch(...) { // log - pData->pTask->m_log.logerr(GetResManager()->LoadString(IDS_OTFCAUGHTEXCEPTIONCCF_STRING), GetLastError()); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFCAUGHTEXCEPTIONCCF_STRING)); + fmt.SetParam(_t("%errno"), GetLastError()); + fmt.SetParam(_t("%timestamp"), GetTickCount()); + pData->pTask->m_log.loge(TSTRFMT, fmt); // close handles if (hSrc != INVALID_HANDLE_VALUE) @@ -870,10 +952,24 @@ // log const BUFFERSIZES* pbs=ccp.dbBuffer.GetSizes(); - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFPROCESSINGFILESDATA_STRING), ccp.bOnlyCreate, - pbs->m_uiDefaultSize, pbs->m_uiOneDiskSize, pbs->m_uiTwoDisksSize, pbs->m_uiCDSize, pbs->m_uiLANSize, - nSize, iCopiesCount, bIgnoreFolders, dpDestPath.GetPath(), pTask->GetCurrentCopy(), pTask->GetCurrentIndex()); + ictranslate::CFormat fmt; + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFPROCESSINGFILESDATA_STRING)); + fmt.SetParam(_t("%create"), ccp.bOnlyCreate); + fmt.SetParam(_t("%defsize"), pbs->m_uiDefaultSize); + fmt.SetParam(_t("%onesize"), pbs->m_uiOneDiskSize); + fmt.SetParam(_t("%twosize"), pbs->m_uiTwoDisksSize); + fmt.SetParam(_t("%cdsize"), pbs->m_uiCDSize); + fmt.SetParam(_t("%lansize"), pbs->m_uiLANSize); + fmt.SetParam(_t("%filecount"), nSize); + fmt.SetParam(_t("%copycount"), iCopiesCount); + fmt.SetParam(_t("%ignorefolders"), bIgnoreFolders); + fmt.SetParam(_t("%dstpath"), dpDestPath.GetPath()); + fmt.SetParam(_t("%currpass"), pTask->GetCurrentCopy()); + fmt.SetParam(_t("%currindex"), pTask->GetCurrentIndex()); + + pTask->m_log.logi(fmt); + for (unsigned char j=pTask->GetCurrentCopy();jSetCurrentCopy(j); @@ -902,8 +998,12 @@ { dwLastError=GetLastError(); //log - pTask->m_log.logerr(GetResManager()->LoadString(IDS_OTFMOVEFILEERROR_STRING), dwLastError, fi.GetFullFilePath(), ccp.strDstFile); - throw new CProcessingException(E_ERROR, pTask, IDS_CPEMOVEFILEERROR_STRING, dwLastError, fi.GetFullFilePath(), ccp.strDstFile); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFMOVEFILEERROR_STRING)); + fmt.SetParam(_t("%errno"), dwLastError); + fmt.SetParam(_t("%srcpath"), fi.GetFullFilePath()); + fmt.SetParam(_t("%dstpath"), ccp.strDstFile); + pTask->m_log.loge(TSTRFMT, fmt); + throw new CProcessingException(E_ERROR, pTask, dwLastError, fmt); } else fi.SetFlags(FIF_PROCESSED, FIF_PROCESSED); @@ -916,8 +1016,11 @@ if (!CreateDirectory(ccp.strDstFile, NULL) && (dwLastError=GetLastError()) != ERROR_ALREADY_EXISTS ) { // log - pTask->m_log.logerr(GetResManager()->LoadString(IDS_OTFCREATEDIRECTORYERROR_STRING), dwLastError, ccp.strDstFile); - throw new CProcessingException(E_ERROR, pTask, IDS_CPECREATEDIRECTORYERROR_STRING, dwLastError, ccp.strDstFile); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFCREATEDIRECTORYERROR_STRING)); + fmt.SetParam(_t("%errno"), dwLastError); + fmt.SetParam(_t("%path"), ccp.strDstFile); + pTask->m_log.loge(TSTRFMT, fmt); + throw new CProcessingException(E_ERROR, pTask, dwLastError, fmt); } pTask->IncreaseProcessedSize(fi.GetLength64()); @@ -1023,8 +1126,17 @@ ::SetThreadPriorityBoost(hThread, GetConfig()->get_bool(PP_CMDISABLEPRIORITYBOOST)); CTime tm=CTime::GetCurrentTime(); - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFTHREADSTART_STRING), tm.GetDay(), tm.GetMonth(), tm.GetYear(), tm.GetHour(), tm.GetMinute(), tm.GetSecond()); + ictranslate::CFormat fmt; + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFTHREADSTART_STRING)); + fmt.SetParam(_t("%year"), tm.GetYear()); + fmt.SetParam(_t("%month"), tm.GetMonth()); + fmt.SetParam(_t("%day"), tm.GetDay()); + fmt.SetParam(_t("%hour"), tm.GetHour()); + fmt.SetParam(_t("%minute"), tm.GetMinute()); + fmt.SetParam(_t("%second"), tm.GetSecond()); + pTask->m_log.logi(fmt); + try { // to make the value stable @@ -1057,7 +1169,10 @@ if (!pTask->GetRequiredFreeSpace(&i64Needed, &i64Available)) { - pTask->m_log.logw(GetResManager()->LoadString(IDS_OTFNOTENOUGHFREESPACE_STRING), i64Needed, i64Available); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFNOTENOUGHFREESPACE_STRING)); + fmt.SetParam(_t("%needsize"), i64Needed); + fmt.SetParam(_t("%availablesize"), i64Available); + pTask->m_log.logw(fmt); // default int iResult=ID_IGNORE; @@ -1140,7 +1255,14 @@ } tm=CTime::GetCurrentTime(); - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFTHREADFINISHED_STRING), tm.GetDay(), tm.GetMonth(), tm.GetYear(), tm.GetHour(), tm.GetMinute(), tm.GetSecond()); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFTHREADFINISHED_STRING)); + fmt.SetParam(_t("%year"), tm.GetYear()); + fmt.SetParam(_t("%month"), tm.GetMonth()); + fmt.SetParam(_t("%day"), tm.GetDay()); + fmt.SetParam(_t("%hour"), tm.GetHour()); + fmt.SetParam(_t("%minute"), tm.GetMinute()); + fmt.SetParam(_t("%second"), tm.GetSecond()); + pTask->m_log.logi(fmt); // we have been killed - the last operation InterlockedIncrement(pTask->m_plFinished); @@ -1156,7 +1278,10 @@ pTask->UpdateTime(); // log - pTask->m_log.logerr(GetResManager()->LoadString(IDS_OTFCAUGHTEXCEPTIONMAIN_STRING), e->m_dwError, e->m_iType); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFCAUGHTEXCEPTIONMAIN_STRING)); + fmt.SetParam(_t("%errno"), e->m_dwError); + fmt.SetParam(_t("%type"), e->m_iType); + pTask->m_log.loge(TSTRFMT, fmt); if (e->m_iType == E_ERROR && GetConfig()->get_bool(PP_SNDPLAYSOUNDS)) { @@ -1403,9 +1528,9 @@ pData->bKilled=false; // some kind of error - CString strErr; - strErr.Format(GetResManager()->LoadString(IDS_SHUTDOWNERROR_STRING), GetLastError()); - AfxMessageBox(strErr, MB_ICONERROR | MB_OK | MB_SYSTEMMODAL); + ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_SHUTDOWNERROR_STRING)); + fmt.SetParam(_t("%errno"), GetLastError()); + AfxMessageBox(fmt, MB_ICONERROR | MB_OK | MB_SYSTEMMODAL); } } } @@ -2113,12 +2238,15 @@ HRESULT hResult = RegisterShellExtDll(strPath, true); if(FAILED(hResult)) { - TCHAR szStr[256], szText[768]; + TCHAR szStr[256]; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, hResult, 0, szStr, 256, NULL); while (szStr[_tcslen(szStr)-1] == _T('\n') || szStr[_tcslen(szStr)-1] == _T('\r') || szStr[_tcslen(szStr)-1] == _T('.')) szStr[_tcslen(szStr)-1]=_T('\0'); - _sntprintf(szText, 768, GetResManager()->LoadString(IDS_REGISTERERR_STRING), hResult, szStr); - AfxMessageBox(szText, MB_ICONERROR | MB_OK); + + ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_REGISTERERR_STRING)); + fmt.SetParam(_T("%errno"), (ulong_t)hResult); + fmt.SetParam(_T("%errdesc"), szStr); + AfxMessageBox(fmt, MB_ICONERROR | MB_OK); } else if(hResult == S_OK) MsgBox(IDS_REGISTEROK_STRING, MB_ICONINFORMATION | MB_OK); @@ -2143,12 +2271,16 @@ HRESULT hResult = RegisterShellExtDll(strPath, false); if(FAILED(hResult)) { - TCHAR szStr[256], szText[768]; + TCHAR szStr[256]; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, hResult, 0, szStr, 256, NULL); while (szStr[_tcslen(szStr)-1] == _T('\n') || szStr[_tcslen(szStr)-1] == _T('\r') || szStr[_tcslen(szStr)-1] == _T('.')) szStr[_tcslen(szStr)-1]=_T('\0'); - _sntprintf(szText, 768, GetResManager()->LoadString(IDS_UNREGISTERERR_STRING), hResult, szStr); - AfxMessageBox(szText, MB_ICONERROR | MB_OK); + + ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_UNREGISTERERR_STRING)); + fmt.SetParam(_T("%errno"), (ulong_t)hResult); + fmt.SetParam(_T("%errdesc"), szStr); + + AfxMessageBox(fmt, MB_ICONERROR | MB_OK); } else if(hResult == S_OK) MsgBox(IDS_UNREGISTEROK_STRING, MB_ICONINFORMATION | MB_OK); @@ -2195,12 +2327,4 @@ void CMainWnd::OnPopupHelp() { GetApp()->HtmlHelp(HH_DISPLAY_TOPIC, NULL); -/* - { - TCHAR szStr[512+2*_MAX_PATH]; - _sntprintf(szStr, 512+2*_MAX_PATH, GetResManager()->LoadString(IDS_HELPERR_STRING), GetApp()->GetHelpPath()); - - AfxMessageBox(szStr, MB_OK | MB_ICONERROR); - } -*/ } \ No newline at end of file Index: src/ch/NotEnoughRoomDlg.cpp =================================================================== diff -u -N -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 -r336bb030d9b4bff561ff100563725213ed6703c9 --- src/ch/NotEnoughRoomDlg.cpp (.../NotEnoughRoomDlg.cpp) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) +++ src/ch/NotEnoughRoomDlg.cpp (.../NotEnoughRoomDlg.cpp) (revision 336bb030d9b4bff561ff100563725213ed6703c9) @@ -66,11 +66,12 @@ void CNotEnoughRoomDlg::UpdateDialog() { // format needed text - TCHAR szText[2048]; - _sntprintf(szText, 2048, GetResManager()->LoadString(IDS_NERPATH_STRING), m_strDisk); + ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_NERPATH_STRING)); + fmt.SetParam(_t("%path"), m_strDisk); + CWnd* pWnd=GetDlgItem(IDC_HEADER_STATIC); if (pWnd) - pWnd->SetWindowText(szText); + pWnd->SetWindowText(fmt); // now the sizes TCHAR szData[128]; Index: src/ch/StatusDlg.cpp =================================================================== diff -u -N -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 -r336bb030d9b4bff561ff100563725213ed6703c9 --- src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) +++ src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision 336bb030d9b4bff561ff100563725213ed6703c9) @@ -848,9 +848,9 @@ // change 'no case' int iClipboard=pSelectedItem->ReplaceClipboardStrings(dlg.m_strSource, dlg.m_strDest); - CString strStats; - strStats.Format(IDS_REPLACEPATHSTEXT_STRING, iClipboard); - AfxMessageBox(strStats); + ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_REPLACEPATHSTEXT_STRING)); + fmt.SetParam(_t("%count"), iClipboard); + AfxMessageBox(fmt); } // resume if earlier was an error @@ -880,8 +880,10 @@ if (lResult < 32) { CString str=CString(szExec)+pTask->GetUniqueName()+_T(".log"); - _sntprintf(szExec, 1024, GetResManager()->LoadString(IDS_SHELLEXECUTEERROR_STRING), lResult, str); - AfxMessageBox(szExec); + ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_SHELLEXECUTEERROR_STRING)); + fmt.SetParam(_t("%errno"), lResult); + fmt.SetParam(_t("%path"), str); + AfxMessageBox(fmt); } } Index: src/ch/Structs.cpp =================================================================== diff -u -N -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 -r336bb030d9b4bff561ff100563725213ed6703c9 --- src/ch/Structs.cpp (.../Structs.cpp) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) +++ src/ch/Structs.cpp (.../Structs.cpp) (revision 336bb030d9b4bff561ff100563725213ed6703c9) @@ -1542,6 +1542,17 @@ va_end(marker); } +CProcessingException::CProcessingException(int iType, CTask* pTask, DWORD dwError, const tchar_t* pszDesc) +{ + // std values + m_iType=iType; + m_pTask=pTask; + m_dwError=dwError; + + // format some text + m_strErrorDesc = pszDesc; +} + void CProcessingException::Cleanup() { TCHAR szPath[_MAX_PATH]; Index: src/ch/Structs.h =================================================================== diff -u -N -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 -r336bb030d9b4bff561ff100563725213ed6703c9 --- src/ch/Structs.h (.../Structs.h) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) +++ src/ch/Structs.h (.../Structs.h) (revision 336bb030d9b4bff561ff100563725213ed6703c9) @@ -407,6 +407,7 @@ public: CProcessingException(int iType, CTask* pTask) { m_iType=iType; m_pTask=pTask; m_dwError=0; }; CProcessingException(int iType, CTask* pTask, UINT uiFmtID, DWORD dwError, ...); + CProcessingException(int iType, CTask* pTask, DWORD dwError, const tchar_t* pszDesc); void Cleanup(); // Implementation Index: src/ch/ch.rc =================================================================== diff -u -N -r328d5100c7f464a4b1fbbbd7ccfa07bf2aaae2cf -r336bb030d9b4bff561ff100563725213ed6703c9 --- src/ch/ch.rc (.../ch.rc) (revision 328d5100c7f464a4b1fbbbd7ccfa07bf2aaae2cf) +++ src/ch/ch.rc (.../ch.rc) (revision 336bb030d9b4bff561ff100563725213ed6703c9) @@ -774,11 +774,10 @@ BEGIN IDS_ONECOPY_STRING "Cannot run the second instance of this program" IDS_REGISTEROK_STRING "Library chext.dll was registered successfully" - IDS_REGISTERERR_STRING "Encountered error while trying to register library chext.dll\nError #%lu (%s)." + IDS_REGISTERERR_STRING "Encountered error while trying to register library chext.dll\nError #%errno (%errdesc)." IDS_UNREGISTEROK_STRING "Library chext.dll was unregistered successfully" IDS_UNREGISTERERR_STRING - "Encountered error while trying to unregister library chext.dll\nError #%lu (%s)." - IDS_HELPERR_STRING "Cannot open html help file:\n%s\n" + "Encountered error while trying to unregister library chext.dll\nError #%errno (%errdesc)." IDS_CRASH_STRING "Copy Handler encountered an internal problem and will be closed.\n\nIf you want to help correct this problem in the future releases of program you can send the crash information to the author of this program." END @@ -801,9 +800,9 @@ IDS_MISSINGDATA_STRING "You didn't fill destination path or source file.\nProgram cannot continue" IDS_CCDCOPY_STRING "Copy" IDS_CCDMOVE_STRING "Move" - IDS_BSEDEFAULT_STRING "Default: %s" - IDS_BSEONEDISK_STRING "One Disk: %s" - IDS_BSETWODISKS_STRING "Two disks: %s" + IDS_BSEDEFAULT_STRING "Default: %size" + IDS_BSEONEDISK_STRING "One Disk: %size" + IDS_BSETWODISKS_STRING "Two disks: %size" END STRINGTABLE @@ -937,7 +936,7 @@ IDS_AVERAGEWORD_STRING "avg: " IDS_STATUSTITLE_STRING "Status" IDS_REPLACEPATHSTEXT_STRING - "Changed:\n%d paths primarily got from clipboard" + "Changed:\n%count paths primarily got from clipboard" IDS_TASKNOTPAUSED_STRING "Selected task isn't paused" IDS_TASKNOTSELECTED_STRING "Task not selected" IDS_NONEINPUTFILE_STRING "(waiting...)" @@ -952,14 +951,14 @@ BEGIN IDS_OTFSEARCHINGFORFILES_STRING "Searching for files..." IDS_OTFMISSINGCLIPBOARDINPUT_STRING - "Source file/folder not found (clipboard) : %s" + "Source file/folder not found (clipboard) : %path" IDS_OTFADDINGCLIPBOARDFILE_STRING - "Adding file/folder (clipboard) : %s ..." - IDS_OTFADDEDFOLDER_STRING "Added folder %s" - IDS_OTFRECURSINGFOLDER_STRING "Recursing folder %s" + "Adding file/folder (clipboard) : %path ..." + IDS_OTFADDEDFOLDER_STRING "Added folder %path" + IDS_OTFRECURSINGFOLDER_STRING "Recursing folder %path" IDS_OTFADDINGKILLREQEST_STRING "Kill request while adding data to files array (RecurseDirectories)" - IDS_OTFADDEDFILE_STRING "Added file %s" + IDS_OTFADDEDFILE_STRING "Added file %path" IDS_OTFSEARCHINGFINISHED_STRING "Searching for files finished" END @@ -969,65 +968,65 @@ IDS_OTFDELETINGKILLREQUEST_STRING "Kill request while deleting files (Delete Files)" IDS_OTFDELETINGERROR_STRING - "Error #%lu (%s) while deleting file/folder %s" + "Error #%errno while deleting file/folder %path" IDS_OTFDELETINGFINISHED_STRING "Deleting files finished" IDS_OTFPRECHECKCANCELREQUEST_STRING - "Cancel request while checking result of dialog before opening source file %s (CustomCopyFile)" + "Cancel request while checking result of dialog before opening source file %path (CustomCopyFile)" IDS_OTFOPENINGERROR_STRING - "Error %err while opening source file %s (CustomCopyFile)" + "Error %errno while opening source file %path (CustomCopyFile)" IDS_OTFOPENINGCANCELREQUEST_STRING - "Cancel request [error %err] while opening source file %s (CustomCopyFile)" + "Cancel request [error %errno] while opening source file %path (CustomCopyFile)" IDS_OTFOPENINGWAITREQUEST_STRING - "Wait request [error %err] while opening source file %s (CustomCopyFile)" + "Wait request [error %errno] while opening source file %path (CustomCopyFile)" IDS_OTFOPENINGRETRY_STRING - "Retrying [error %err] to open source file %s (CustomCopyFile)" + "Retrying [error %errno] to open source file %path (CustomCopyFile)" IDS_OTFDESTOPENINGERROR_STRING - "Error %err while opening destination file %s (CustomCopyFile)" + "Error %errno while opening destination file %path (CustomCopyFile)" IDS_OTFDESTOPENINGRETRY_STRING - "Retrying [error %err] to open destination file %s (CustomCopyFile)" + "Retrying [error %errno] to open destination file %path (CustomCopyFile)" IDS_OTFDESTOPENINGCANCELREQUEST_STRING - "Cancel request [error %err] while opening destination file %s (CustomCopyFile)" + "Cancel request [error %errno] while opening destination file %path (CustomCopyFile)" IDS_OTFDESTOPENINGWAITREQUEST_STRING - "Wait request [error %err] while opening destination file %s (CustomCopyFile)" + "Wait request [error %errno] while opening destination file %path (CustomCopyFile)" IDS_OTFMOVINGPOINTERSERROR_STRING - "Error %err while moving file pointers of %s and %s to %I64u" + "Error %errno while moving file pointers of %srcpath and %dstpath to %pos" IDS_OTFRESTORINGPOINTERSERROR_STRING - "Error %err while restoring (moving to beginning) file pointers of %s and %s" + "Error %errno while restoring (moving to beginning) file pointers of %srcpath and %dstpath" IDS_OTFSETTINGZEROSIZEERROR_STRING - "Error %err while setting size of file %s to 0" + "Error %errno while setting size of file %path to 0" END STRINGTABLE BEGIN IDS_OTFCOPYINGKILLREQUEST_STRING - "Kill request while main copying file %s -> %s" + "Kill request while main copying file %srcpath -> %dstpath" IDS_OTFCHANGINGBUFFERSIZE_STRING - "Changing buffer size from [Def:%lu, One:%lu, Two:%lu, CD:%lu, LAN:%lu] to [Def:%lu, One:%lu, Two:%lu, CD:%lu, LAN:%lu] wile copying %s -> %s (CustomCopyFile)" + "Changing buffer size from [Def:%defsize, One:%onesize, Two:%twosize, CD:%cdsize, LAN:%lansize] to [Def:%defsize2, One:%onesize2, Two:%twosize2, CD:%cdsize2, LAN:%lansize2] wile copying %srcfile -> %dstfile (CustomCopyFile)" IDS_OTFREADINGERROR_STRING - "Error %err while trying to read %d bytes from source file %s (CustomCopyFile)" + "Error %errno while trying to read %count bytes from source file %path (CustomCopyFile)" IDS_OTFWRITINGERROR_STRING - "Error %err while trying to write %d bytes to destination file %s (CustomCopyFile)" + "Error %errno while trying to write %count bytes to destination file %path (CustomCopyFile)" IDS_OTFCAUGHTEXCEPTIONCCF_STRING - "Caught exception in CustomCopyFile [last error: %err] (at time %lu)" + "Caught exception in CustomCopyFile [last error: %errno] (at time %timestamp)" IDS_OTFPROCESSINGFILES_STRING "Processing files/folders (ProcessFiles)" IDS_OTFPROCESSINGFILESDATA_STRING - "Processing files/folders (ProcessFiles):\r\n\tOnlyCreate: %d\r\n\tBufferSize: [Def:%lu, One:%lu, Two:%lu, CD:%lu, LAN:%lu]\r\n\tFiles/folders count: %lu\r\n\tCopies count: %d\r\n\tIgnore Folders: %d\r\n\tDest path: %s\r\n\tCurrent pass (0-based): %d\r\n\tCurrent index (0-based): %d" + "Processing files/folders (ProcessFiles):\r\n\tOnlyCreate: %create\r\n\tBufferSize: [Def:%defsize, One:%onesize, Two:%twosize, CD:%cdsize, LAN:%lansize]\r\n\tFiles/folders count: %filecount\r\n\tCopies count: %copycount\r\n\tIgnore Folders: %ignorefolders\r\n\tDest path: %dstpath\r\n\tCurrent pass (0-based): %currpass\r\n\tCurrent index (0-based): %currindex" IDS_OTFPROCESSINGKILLREQUEST_STRING "Kill request while processing file in ProcessFiles" IDS_OTFMOVEFILEERROR_STRING - "Error %err while calling MoveFile %s -> %s (ProcessFiles)" + "Error %errno while calling MoveFile %srcpath -> %dstpath (ProcessFiles)" IDS_OTFCREATEDIRECTORYERROR_STRING - "Error %err while calling CreateDirectory %s (ProcessFiles)" + "Error %errno while calling CreateDirectory %path (ProcessFiles)" IDS_OTFPROCESSINGFINISHED_STRING "Finished processing in ProcessFiles" IDS_OTFTHREADSTART_STRING - "\r\n# COPYING THREAD STARTED #\r\nBegan processing data (dd:mm:yyyy) %02d.%02d.%4d at %02d:%02d.%02d" + "\r\n# COPYING THREAD STARTED #\r\nBegan processing data (dd:mm:yyyy) %day.%month.%year at %hour:%minute.%second" IDS_OTFWAITINGFINISHED_STRING "Finished waiting for begin permission" IDS_OTFWAITINGKILLREQUEST_STRING "Kill request while waiting for begin permission (wait state)" IDS_OTFTHREADFINISHED_STRING - "Finished processing data (dd:mm:yyyy) %02d.%02d.%4d at %02d:%02d.%02d" + "Finished processing data (dd:mm:yyyy) %day.%month.%year at %hour:%minute.%second" IDS_OTFCAUGHTEXCEPTIONMAIN_STRING - "Caught exception in ThrdProc [last error: %err, type: %d]" + "Caught exception in ThrdProc [last error: %errno, type: %type]" END STRINGTABLE @@ -1055,14 +1054,14 @@ IDS_STATUS9_STRING "Waiting" IDS_STATUS10_STRING "Only files" IDS_STATUS11_STRING "Without contents" - IDS_SHELLEXECUTEERROR_STRING "Error #%lu calling ShellExecute for file %s" + IDS_SHELLEXECUTEERROR_STRING "Error #%errno calling ShellExecute for file %path" IDS_BSDEFAULT_STRING "Default: " END STRINGTABLE BEGIN - IDS_FIRSTCOPY_STRING "Copy of %s" - IDS_NEXTCOPY_STRING "Copy (%d) of %s" + IDS_FIRSTCOPY_STRING "Copy of %name" + IDS_NEXTCOPY_STRING "Copy (%count) of %name" IDS_NOTFOUND_STRING "File not found (doesn't exist)" IDS_BYTE_STRING "B" IDS_KBYTE_STRING "kB" @@ -1082,14 +1081,12 @@ IDS_OTFCHECKINGSPACE_STRING "Checking for free space on destination disk..." IDS_OTFNOTENOUGHFREESPACE_STRING - "Not enough free space on disk - needed %I64d bytes for data, available: %I64d bytes." + "Not enough free space on disk - needed %needsize bytes for data, available: %availablesize bytes." IDS_OTFFREESPACECANCELREQUEST_STRING "Cancel request while checking for free space on disk." IDS_OTFFREESPACERETRYING_STRING "Retrying to read drive's free space..." IDS_OTFFREESPACEIGNORE_STRING "Ignored warning about not enough place on disk to copy data." - IDS_OTFMOVEFILECANCELREQUEST_STRING - "Cancel request while calling MoveFileEx %s -> %s (ProcessFiles)" END STRINGTABLE @@ -1098,24 +1095,6 @@ IDS_BSTWODISKS_STRING "Two disks: " IDS_BSCD_STRING "CD: " IDS_BSLAN_STRING "LAN: " - IDS_CPEDELETINGERROR_STRING - "Error #%errnum (%errdesc) while deleting file %s" - IDS_CPEOPENINGERROR_STRING - "Error #%errnum (%errdesc) while trying to open source file %s" - IDS_CPEDESTOPENINGERROR_STRING - "Error #%errnum (%errdesc) while trying to open destination file %s. Probably file has read-only attribute set, and 'Protect read-only files' flag in configuration is set (so the file cannot be open to write)." - IDS_CPERESTORINGPOINTERSERROR_STRING - "Error #%errnum (%errdesc) while restoring (moving to beginning) file pointers of %s and %s" - IDS_CPESETTINGZEROSIZEERROR_STRING - "Error #%errnum (%errdesc) while setting size of file %s to 0" - IDS_CPEREADINGERROR_STRING - "Error #%errnum (%errdesc) while trying to read %d bytes from source file %s" - IDS_CPEWRITINGERROR_STRING - "Error #%errnum (%errdesc) while trying to write %d bytes to destination file %s" - IDS_CPEMOVEFILEERROR_STRING - "Error #%errnum (%errdesc) while calling MoveFile %s -> %s" - IDS_CPECREATEDIRECTORYERROR_STRING - "Error #%errnum (%errdesc) while calling CreateDirectory %s" IDS_EMPTYASSOCFILE_STRING "not associated" IDS_FILTERING_STRING " [with filter]" IDS_CONFIRMCANCEL_STRING @@ -1125,7 +1104,7 @@ STRINGTABLE BEGIN IDS_SHUTDOWNERROR_STRING - "Cannot shutdown this operating system.\nEncountered error #%lu." + "Cannot shutdown this operating system.\nEncountered error #%errno." END STRINGTABLE @@ -1153,8 +1132,8 @@ STRINGTABLE BEGIN - IDS_BSECD_STRING "CD: %s" - IDS_BSELAN_STRING "LAN: %s" + IDS_BSECD_STRING "CD: %size" + IDS_BSELAN_STRING "LAN: %size" IDS_HDRMASK_STRING "Include mask" IDS_HDRSIZE_STRING "Size" IDS_HDRDATE_STRING "Date" @@ -1168,7 +1147,7 @@ IDS_FILTERATTRIB_STRING "none" IDS_EMPTYFILTER_STRING "None of filtering options were selected" IDS_FLTALLFILTER_STRING "All files (*.*)|*.*||" - IDS_IMPORTREPORT_STRING "Imported %lu path(s)" + IDS_IMPORTREPORT_STRING "Imported %count path(s)" END STRINGTABLE @@ -1270,14 +1249,12 @@ STRINGTABLE BEGIN - IDS_ABOUTVERSION_STRING "Compilation: %s" - IDS_LANGCODE_STRING "Code=" - IDS_LANGVER_STRING "Version=" + IDS_ABOUTVERSION_STRING "Compilation: " END STRINGTABLE BEGIN - IDS_NERPATH_STRING "There is not enough room in %s to copy or move:" + IDS_NERPATH_STRING "There is not enough room in %path to copy or move:" END #endif // English (U.S.) resources Index: src/ch/resource.h =================================================================== diff -u -N -ra1df59e4b47f6d8c347f3cff6cfd1a83cd0ec848 -r336bb030d9b4bff561ff100563725213ed6703c9 --- src/ch/resource.h (.../resource.h) (revision a1df59e4b47f6d8c347f3cff6cfd1a83cd0ec848) +++ src/ch/resource.h (.../resource.h) (revision 336bb030d9b4bff561ff100563725213ed6703c9) @@ -324,7 +324,6 @@ #define IDS_REGISTERERR_STRING 6002 #define IDS_UNREGISTEROK_STRING 6003 #define IDS_UNREGISTERERR_STRING 6004 -#define IDS_HELPERR_STRING 6005 #define IDS_CRASH_STRING 6006 #define IDS_OTFSEARCHINGFORFILES_STRING 7000 #define IDS_OTFMISSINGCLIPBOARDINPUT_STRING 7001 @@ -373,7 +372,6 @@ #define IDS_OTFFREESPACEIGNORE_STRING 7044 #define IDS_OTFSHRINKERROR_STRING 7045 #define IDS_OTFEXTMOVEFILEERROR_STRING 7046 -#define IDS_OTFMOVEFILECANCELREQUEST_STRING 7047 #define IDS_PROGRAM_STRING 8000 #define IDS_CLIPBOARDMONITORING_STRING 8001 #define IDS_CLIPBOARDINTERVAL_STRING 8002 @@ -528,8 +526,6 @@ #define IDS_MAINBROWSETEXT_STRING 13503 #define IDS_ABTNOTHANX_STRING 14000 #define IDS_ABOUTVERSION_STRING 14001 -#define IDS_LANGCODE_STRING 14002 -#define IDS_LANGVER_STRING 14003 #define IDS_BUFFERSIZEZERO_STRING 14500 #define IDS_FILEDLGALLFILTER_STRING 15000 #define IDS_DSTFOLDERBROWSE_STRING 15001 @@ -604,15 +600,6 @@ #define IDS_BSTWODISKS_STRING 21537 #define IDS_BSCD_STRING 21538 #define IDS_BSLAN_STRING 21539 -#define IDS_CPEDELETINGERROR_STRING 21540 -#define IDS_CPEOPENINGERROR_STRING 21541 -#define IDS_CPEDESTOPENINGERROR_STRING 21542 -#define IDS_CPERESTORINGPOINTERSERROR_STRING 21543 -#define IDS_CPESETTINGZEROSIZEERROR_STRING 21544 -#define IDS_CPEREADINGERROR_STRING 21545 -#define IDS_CPEWRITINGERROR_STRING 21546 -#define IDS_CPEMOVEFILEERROR_STRING 21547 -#define IDS_CPECREATEDIRECTORYERROR_STRING 21548 #define IDS_EMPTYASSOCFILE_STRING 21549 #define IDS_FILTERING_STRING 21550 #define IDS_CONFIRMCANCEL_STRING 21551