Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2017-08-22 02:33:15 +0300
committerKacper Michajłow <kasper93@gmail.com>2017-08-28 00:14:48 +0300
commit7c77ba9afcea150c1b8cd01386f82ef36b512456 (patch)
treef01048b9dec2cce63263713e41b7407d51f66fd5
parentdcd43a430ca2782c4ae166e89139c730bffc5d88 (diff)
Do not pass incompatible object to variadic functions.
-rw-r--r--src/DSUtil/DSUtil.cpp2
-rw-r--r--src/DSUtil/DSUtil.h6
-rw-r--r--src/DSUtil/HdmvClipInfo.cpp8
-rw-r--r--src/DSUtil/MediaTypeEx.cpp12
-rw-r--r--src/DSUtil/WinAPIUtils.cpp14
-rw-r--r--src/DeCSS/VobFile.cpp2
-rw-r--r--src/Subtitles/RTS.cpp4
-rw-r--r--src/Subtitles/STS.cpp36
-rw-r--r--src/Subtitles/SubtitleHelpers.cpp4
-rw-r--r--src/Subtitles/VobSubFile.cpp24
-rw-r--r--src/Subtitles/VobSubFileRipper.cpp2
-rw-r--r--src/filters/PinInfoWnd.cpp10
-rw-r--r--src/filters/muxer/BaseMuxer/BaseMuxerOutputPin.cpp10
-rw-r--r--src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp7
-rw-r--r--src/filters/renderer/VideoRenderers/IPinHook.cpp18
-rw-r--r--src/filters/renderer/VideoRenderers/SyncRenderer.cpp6
-rw-r--r--src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp2
-rw-r--r--src/filters/source/SubtitleSource/SubtitleSource.cpp4
-rw-r--r--src/filters/transform/VSFilter/plugins.cpp6
-rw-r--r--src/mpc-hc/AboutDlg.cpp8
-rw-r--r--src/mpc-hc/AppSettings.cpp4
-rw-r--r--src/mpc-hc/CmdLineHelpDlg.cpp4
-rw-r--r--src/mpc-hc/DVBChannel.cpp8
-rw-r--r--src/mpc-hc/EditListEditor.cpp2
-rw-r--r--src/mpc-hc/FGFilter.cpp4
-rw-r--r--src/mpc-hc/FGFilterLAV.cpp2
-rw-r--r--src/mpc-hc/FGManager.cpp6
-rw-r--r--src/mpc-hc/FileAssoc.cpp4
-rw-r--r--src/mpc-hc/MainFrm.cpp153
-rw-r--r--src/mpc-hc/MediaFormats.cpp4
-rw-r--r--src/mpc-hc/Mpeg2SectionData.cpp4
-rw-r--r--src/mpc-hc/PPageCapture.cpp2
-rw-r--r--src/mpc-hc/PPageFileInfoDetails.cpp4
-rw-r--r--src/mpc-hc/PPageFormats.cpp6
-rw-r--r--src/mpc-hc/PPageFullscreen.cpp4
-rw-r--r--src/mpc-hc/PPageOutput.cpp16
-rw-r--r--src/mpc-hc/PPageSubtitles.cpp6
-rw-r--r--src/mpc-hc/PlayerPlaylistBar.cpp8
-rw-r--r--src/mpc-hc/PlayerSeekBar.cpp2
-rw-r--r--src/mpc-hc/PnSPresetsDlg.cpp4
-rw-r--r--src/mpc-hc/SaveDlg.cpp8
-rw-r--r--src/mpc-hc/SkypeMoodMsgHandler.cpp6
-rw-r--r--src/mpc-hc/SubtitleDlDlg.cpp4
-rw-r--r--src/mpc-hc/SubtitlesProvider.h2
-rw-r--r--src/mpc-hc/SubtitlesProviders.cpp2
-rw-r--r--src/mpc-hc/TunerScanDlg.cpp4
-rw-r--r--src/mpc-hc/UpdateChecker.cpp2
-rw-r--r--src/mpc-hc/UpdateCheckerDlg.cpp10
-rw-r--r--src/mpc-hc/VMROSD.cpp6
-rw-r--r--src/mpc-hc/WebClientSocket.cpp8
-rw-r--r--src/mpc-hc/WebServer.cpp4
-rw-r--r--src/mpc-hc/mplayerc.cpp22
52 files changed, 255 insertions, 255 deletions
diff --git a/src/DSUtil/DSUtil.cpp b/src/DSUtil/DSUtil.cpp
index 161fdeb2b..a20e8b3fe 100644
--- a/src/DSUtil/DSUtil.cpp
+++ b/src/DSUtil/DSUtil.cpp
@@ -791,7 +791,7 @@ OpticalDiskType_t GetOpticalDiskType(TCHAR drive, CAtlList<CString>& files)
trackData.Control &= 5;
if (trackData.Control == 0 || trackData.Control == 1) {
CString fn;
- fn.Format(_T("%s\\track%02Id.cda"), path, i);
+ fn.Format(_T("%s\\track%02Id.cda"), path.GetString(), i);
files.AddTail(fn);
}
}
diff --git a/src/DSUtil/DSUtil.h b/src/DSUtil/DSUtil.h
index a66f51da0..46a742310 100644
--- a/src/DSUtil/DSUtil.h
+++ b/src/DSUtil/DSUtil.h
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2016 see Authors.txt
+ * (C) 2006-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -238,8 +238,8 @@ public:
#define SAFE_RELEASE(p) { if (p) { (p)->Release(); (p) = nullptr; } }
#define SAFE_CLOSE_HANDLE(p) { if (p) { if ((p) != INVALID_HANDLE_VALUE) VERIFY(CloseHandle(p)); (p) = nullptr; } }
-#define StrRes(id) MAKEINTRESOURCE(id)
-#define ResStr(id) CString(StrRes(id))
+#define StrRes(id) MAKEINTRESOURCE((id))
+#define ResStr(id) CString(StrRes((id)))
#define UNREACHABLE_CODE() \
do { \
diff --git a/src/DSUtil/HdmvClipInfo.cpp b/src/DSUtil/HdmvClipInfo.cpp
index 0c387e3dc..b4b225808 100644
--- a/src/DSUtil/HdmvClipInfo.cpp
+++ b/src/DSUtil/HdmvClipInfo.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2008-2014 see Authors.txt
+ * (C) 2008-2014, 2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -295,7 +295,7 @@ HRESULT CHdmvClipInfo::ReadPlaylist(CString strPlaylistFile, REFERENCE_TIME& rtD
SetFilePointerEx(m_hFile, Pos, nullptr, FILE_BEGIN);
Pos.QuadPart += ReadShort() + 2;
ReadBuffer(Buff, 5);
- Item.m_strFileName.Format(_T("%s\\STREAM\\%c%c%c%c%c.M2TS"), Path, Buff[0], Buff[1], Buff[2], Buff[3], Buff[4]);
+ Item.m_strFileName.Format(_T("%s\\STREAM\\%c%c%c%c%c.M2TS"), static_cast<LPCTSTR>(Path), Buff[0], Buff[1], Buff[2], Buff[3], Buff[4]);
ReadBuffer(Buff, 4);
if (memcmp(Buff, "M2TS", 4)) {
@@ -415,7 +415,7 @@ HRESULT CHdmvClipInfo::FindMainMovie(LPCTSTR strFolder, CString& strPlaylistFile
strPath.Replace(_T("\\PLAYLIST\\"), _T("\\"));
strPath.Replace(_T("\\STREAM\\"), _T("\\"));
strPath += _T("\\BDMV\\");
- strFilter.Format(_T("%sPLAYLIST\\*.mpls"), strPath);
+ strFilter.Format(_T("%sPLAYLIST\\*.mpls"), strPath.GetString());
HANDLE hFind = FindFirstFile(strFilter, &fd);
if (hFind != INVALID_HANDLE_VALUE) {
@@ -423,7 +423,7 @@ HRESULT CHdmvClipInfo::FindMainMovie(LPCTSTR strFolder, CString& strPlaylistFile
REFERENCE_TIME rtCurrent;
CString strCurrentPlaylist;
do {
- strCurrentPlaylist.Format(_T("%sPLAYLIST\\%s"), strPath, fd.cFileName);
+ strCurrentPlaylist.Format(_T("%sPLAYLIST\\%s"), strPath.GetString(), fd.cFileName);
Playlist.RemoveAll();
// Main movie shouldn't have duplicate M2TS filename...
diff --git a/src/DSUtil/MediaTypeEx.cpp b/src/DSUtil/MediaTypeEx.cpp
index 40d6dd1e5..fbcfaf768 100644
--- a/src/DSUtil/MediaTypeEx.cpp
+++ b/src/DSUtil/MediaTypeEx.cpp
@@ -468,11 +468,11 @@ void CMediaTypeEx::Dump(CAtlList<CString>& sl)
sl.AddTail(ToString() + _T("\n"));
sl.AddTail(_T("AM_MEDIA_TYPE: "));
- str.Format(_T("majortype: %S %s"), GuidNames[majortype], major);
+ str.Format(_T("majortype: %S %s"), GuidNames[majortype], major.GetString());
sl.AddTail(str);
- str.Format(_T("subtype: %S %s"), GuidNames[subtype], sub);
+ str.Format(_T("subtype: %S %s"), GuidNames[subtype], sub.GetString());
sl.AddTail(str);
- str.Format(_T("formattype: %S %s"), GuidNames[formattype], format);
+ str.Format(_T("formattype: %S %s"), GuidNames[formattype], format.GetString());
sl.AddTail(str);
str.Format(_T("bFixedSizeSamples: %d"), bFixedSizeSamples);
sl.AddTail(str);
@@ -641,7 +641,7 @@ void CMediaTypeEx::Dump(CAtlList<CString>& sl)
sl.AddTail(str);
str.Format(_T("dwChannelMask: 0x%08x"), wfextensible.dwChannelMask);
sl.AddTail(str);
- str.Format(_T("SubFormat: %s"), CStringFromGUID(wfextensible.SubFormat));
+ str.Format(_T("SubFormat: %s"), CStringFromGUID(wfextensible.SubFormat).GetString());
sl.AddTail(str);
sl.AddTail(_T(""));
@@ -709,9 +709,9 @@ void CMediaTypeEx::Dump(CAtlList<CString>& sl)
sl.AddTail(_T("SUBTITLEINFO:"));
str.Format(_T("dwOffset: %lu"), si.dwOffset);
sl.AddTail(str);
- str.Format(_T("IsoLang: %s"), CString(CStringA(si.IsoLang, sizeof(si.IsoLang) - 1)));
+ str.Format(_T("IsoLang: %S"), CStringA(si.IsoLang, sizeof(si.IsoLang) - 1).GetString());
sl.AddTail(str);
- str.Format(_T("TrackName: %s"), CString(CStringW(si.TrackName, sizeof(si.TrackName) - 1)));
+ str.Format(_T("TrackName: %s"), CStringW(si.TrackName, sizeof(si.TrackName) - 1).GetString());
sl.AddTail(str);
sl.AddTail(_T(""));
diff --git a/src/DSUtil/WinAPIUtils.cpp b/src/DSUtil/WinAPIUtils.cpp
index 3288b691b..0e3fe534c 100644
--- a/src/DSUtil/WinAPIUtils.cpp
+++ b/src/DSUtil/WinAPIUtils.cpp
@@ -99,7 +99,7 @@ bool ExportRegistryKey(CStdioFile& file, HKEY hKeyRoot, CString keyName)
CString buffer;
- buffer.Format(_T("[%s\\%s]\n"), GetHiveName(hKeyRoot), keyName);
+ buffer.Format(_T("[%s\\%s]\n"), GetHiveName(hKeyRoot).GetString(), keyName.GetString());
file.WriteString(buffer);
CString valueName;
@@ -121,12 +121,12 @@ bool ExportRegistryKey(CStdioFile& file, HKEY hKeyRoot, CString keyName)
CString str((TCHAR*)data);
str.Replace(_T("\\"), _T("\\\\"));
str.Replace(_T("\""), _T("\\\""));
- buffer.Format(_T("\"%s\"=\"%s\"\n"), valueName, str);
+ buffer.Format(_T("\"%s\"=\"%s\"\n"), valueName.GetString(), str.GetString());
file.WriteString(buffer);
}
break;
case REG_BINARY:
- buffer.Format(_T("\"%s\"=hex:%02x"), valueName, data[0]);
+ buffer.Format(_T("\"%s\"=hex:%02x"), valueName.GetString(), data[0]);
file.WriteString(buffer);
for (DWORD i = 1; i < valueDataLen; i++) {
buffer.Format(_T(",%02x"), data[i]);
@@ -135,13 +135,13 @@ bool ExportRegistryKey(CStdioFile& file, HKEY hKeyRoot, CString keyName)
file.WriteString(_T("\n"));
break;
case REG_DWORD:
- buffer.Format(_T("\"%s\"=dword:%08lx\n"), valueName, *((DWORD*)data));
+ buffer.Format(_T("\"%s\"=dword:%08lx\n"), valueName.GetString(), *((DWORD*)data));
file.WriteString(buffer);
break;
default: {
CString msg;
msg.Format(_T("The value \"%s\\%s\\%s\" has an unsupported type and has been ignored.\nPlease report this error to the developers."),
- GetHiveName(hKeyRoot), keyName, valueName);
+ GetHiveName(hKeyRoot).GetString(), keyName.GetString(), valueName.GetString());
AfxMessageBox(msg, MB_ICONERROR | MB_OK);
}
delete [] data;
@@ -165,7 +165,7 @@ bool ExportRegistryKey(CStdioFile& file, HKEY hKeyRoot, CString keyName)
return false;
}
- buffer.Format(_T("%s\\%s"), keyName, subKeyName);
+ buffer.Format(_T("%s\\%s"), keyName.GetString(), subKeyName.GetString());
if (!ExportRegistryKey(file, hKeyRoot, buffer)) {
return false;
@@ -300,6 +300,6 @@ HRESULT FileDelete(CString file, HWND hWnd, bool recycle /*= true*/)
if (fileOpStruct.fAnyOperationsAborted) {
hRes = E_ABORT;
}
- TRACE(_T("Delete recycle=%d hRes=0x%08x, file=%s\n"), recycle, hRes, file);
+ TRACE(_T("Delete recycle=%d hRes=0x%08x, file=%s\n"), recycle, hRes, file.GetString());
return hRes;
}
diff --git a/src/DeCSS/VobFile.cpp b/src/DeCSS/VobFile.cpp
index 3ef313181..42d1b78f4 100644
--- a/src/DeCSS/VobFile.cpp
+++ b/src/DeCSS/VobFile.cpp
@@ -609,7 +609,7 @@ bool CVobFile::Open(CString fn, CAtlList<CString>& vobs, ULONG nProgNum /*= 1*/,
fn.TrimRight(_T(".0123456789"));
for (int i = 0; i < 100; i++) {
CString vob;
- vob.Format(_T("%s%d.vob"), fn, i);
+ vob.Format(_T("%s%d.vob"), fn.GetString(), i);
CFileStatus status;
if (!CFile::GetStatus(vob, status)) {
diff --git a/src/Subtitles/RTS.cpp b/src/Subtitles/RTS.cpp
index 7d653593b..f9911ab13 100644
--- a/src/Subtitles/RTS.cpp
+++ b/src/Subtitles/RTS.cpp
@@ -3263,9 +3263,9 @@ STDMETHODIMP CRenderedTextSubtitle::GetStreamInfo(int iStream, WCHAR** ppName, L
}
CStringW strName;
if (!m_provider.IsEmpty()) {
- strName.Format(L"[%s] %s\t%s", m_provider, m_name, strLanguage);
+ strName.Format(L"[%s] %s\t%s", m_provider.GetString(), m_name.GetString(), strLanguage.GetString());
} else {
- strName.Format(L"%s\t%s", m_name, strLanguage);
+ strName.Format(L"%s\t%s", m_name.GetString(), strLanguage.GetString());
}
*ppName = (WCHAR*)CoTaskMemAlloc((strName.GetLength() + 1) * sizeof(WCHAR));
diff --git a/src/Subtitles/STS.cpp b/src/Subtitles/STS.cpp
index 68c46c86b..ec4d67e7c 100644
--- a/src/Subtitles/STS.cpp
+++ b/src/Subtitles/STS.cpp
@@ -798,7 +798,7 @@ static CStringW MicroDVD2SSA(CStringW str, bool fUnicode, int CharSet)
} else if (!_wcsnicmp(code, L"{f:", 3)) {
fRestore[FONTNAME] = (iswupper(code[1]) == 0);
- code.Format(L"{\\fn%s}", code.Mid(3));
+ code.Format(L"{\\fn%s}", code.Mid(3).GetString());
ret += code;
} else if (!_wcsnicmp(code, L"{s:", 3)) {
fRestore[FONTSIZE] = (iswupper(code[1]) == 0);
@@ -2097,7 +2097,7 @@ void CSimpleTextSubtitle::ChangeUnknownStylesToDefault()
if (!unknown.Lookup(stse.style, val)) {
if (fReport) {
CString msg;
- msg.Format(_T("Unknown style found: \"%s\", changed to \"Default\"!\n\nPress Cancel to ignore further warnings."), stse.style);
+ msg.Format(_T("Unknown style found: \"%s\", changed to \"Default\"!\n\nPress Cancel to ignore further warnings."), stse.style.GetString());
if (MessageBox(nullptr, msg, _T("Warning"), MB_OKCANCEL | MB_ICONWARNING) != IDOK) {
fReport = false;
}
@@ -2143,7 +2143,7 @@ void CSimpleTextSubtitle::AddStyle(CString name, STSStyle* style)
CString name3;
do {
- name3.Format(_T("%s%d"), name2, idx);
+ name3.Format(_T("%s%d"), name2.GetString(), idx);
idx++;
} while (m_styles.Lookup(name3));
@@ -2644,7 +2644,7 @@ bool CSimpleTextSubtitle::Open(CTextFile* f, int CharSet, CString name)
CString lastLine;
size_t n = CountLines(f, pos, f->GetPosition(), lastLine);
CString msg;
- msg.Format(_T("Unable to parse the subtitle file. Syntax error at line %Iu:\n\"%s\""), n + 1, lastLine);
+ msg.Format(_T("Unable to parse the subtitle file. Syntax error at line %Iu:\n\"%s\""), n + 1, lastLine.GetString());
AfxMessageBox(msg, MB_OK | MB_ICONERROR);
Empty();
break;
@@ -2798,8 +2798,8 @@ bool CSimpleTextSubtitle::SaveAs(CString fn, Subtitle::SubType type,
if (type == Subtitle::SSA) {
CString str2;
- str2.Format(str, key,
- s->fontName, (int)s->fontSize,
+ str2.Format(str, key.GetString(),
+ s->fontName.GetString(), (int)s->fontSize,
s->colors[0] & 0xffffff,
s->colors[1] & 0xffffff,
s->colors[2] & 0xffffff,
@@ -2814,8 +2814,8 @@ bool CSimpleTextSubtitle::SaveAs(CString fn, Subtitle::SubType type,
f.WriteString(str2);
} else {
CString str2;
- str2.Format(str, key,
- s->fontName, (int)s->fontSize,
+ str2.Format(str, key.GetString(),
+ s->fontName.GetString(), (int)s->fontSize,
(s->colors[0] & 0xffffff) | (s->alpha[0] << 24),
(s->colors[1] & 0xffffff) | (s->alpha[1] << 24),
(s->colors[2] & 0xffffff) | (s->alpha[2] << 24),
@@ -2884,33 +2884,33 @@ bool CSimpleTextSubtitle::SaveAs(CString fn, Subtitle::SubType type,
CStringW str2;
if (type == Subtitle::SRT) {
- str2.Format(fmt, i - k + 1, hh1, mm1, ss1, ms1, hh2, mm2, ss2, ms2, str);
+ str2.Format(fmt, i - k + 1, hh1, mm1, ss1, ms1, hh2, mm2, ss2, ms2, str.GetString());
} else if (type == Subtitle::SUB) {
str.Replace('\n', '|');
- str2.Format(fmt, int(t1 * fps / 1000), int(t2 * fps / 1000), str);
+ str2.Format(fmt, int(t1 * fps / 1000), int(t2 * fps / 1000), str.GetString());
} else if (type == Subtitle::SMI) {
str.Replace(L"\n", L"<br>");
- str2.Format(fmt, t1, str, t2);
+ str2.Format(fmt, t1, str.GetString(), t2);
} else if (type == Subtitle::PSB) {
str.Replace('\n', '|');
- str2.Format(fmt, hh1, mm1, ss1, hh2, mm2, ss2, str);
+ str2.Format(fmt, hh1, mm1, ss1, hh2, mm2, ss2, str.GetString());
} else if (type == Subtitle::SSA) {
str.Replace(L"\n", L"\\N");
str2.Format(fmt,
hh1, mm1, ss1, ms1 / 10,
hh2, mm2, ss2, ms2 / 10,
- TToW(stse.style), TToW(stse.actor),
+ TToW(stse.style).GetString(), TToW(stse.actor).GetString(),
stse.marginRect.left, stse.marginRect.right, (stse.marginRect.top + stse.marginRect.bottom) / 2,
- TToW(stse.effect), str);
+ TToW(stse.effect).GetString(), str.GetString());
} else if (type == Subtitle::ASS) {
str.Replace(L"\n", L"\\N");
str2.Format(fmt,
stse.layer,
hh1, mm1, ss1, ms1 / 10,
hh2, mm2, ss2, ms2 / 10,
- TToW(stse.style), TToW(stse.actor),
+ TToW(stse.style).GetString(), TToW(stse.actor).GetString(),
stse.marginRect.left, stse.marginRect.right, (stse.marginRect.top + stse.marginRect.bottom) / 2,
- TToW(stse.effect), str);
+ TToW(stse.effect).GetString(), str.GetString());
}
f.WriteString(str2);
@@ -2941,7 +2941,7 @@ bool CSimpleTextSubtitle::SaveAs(CString fn, Subtitle::SubType type,
str = _T("Style: Default,%s,%d,&H%08x,&H%08x,&H%08x,&H%08x,%d,%d,%d,%d,%.2f,%.2f,%.2f,%.2f,%d,%.2f,%.2f,%d,%d,%d,%d,%d\n");
str2.Format(str,
- s->fontName, (int)s->fontSize,
+ s->fontName.GetString(), (int)s->fontSize,
(s->colors[0] & 0xffffff) | (s->alpha[0] << 24),
(s->colors[1] & 0xffffff) | (s->alpha[1] << 24),
(s->colors[2] & 0xffffff) | (s->alpha[2] << 24),
@@ -3088,7 +3088,7 @@ CString& operator <<= (CString& style, const STSStyle& s)
s.colors[0], s.colors[1], s.colors[2], s.colors[3],
s.alpha[0], s.alpha[1], s.alpha[2], s.alpha[3],
s.charSet,
- s.fontName, s.fontSize,
+ s.fontName.GetString(), s.fontSize,
s.fontScaleX, s.fontScaleY,
s.fontSpacing, s.fontWeight,
s.fItalic, s.fUnderline, s.fStrikeOut, s.fBlur, s.fGaussianBlur,
diff --git a/src/Subtitles/SubtitleHelpers.cpp b/src/Subtitles/SubtitleHelpers.cpp
index 4aea67ad9..c09dbf6a2 100644
--- a/src/Subtitles/SubtitleHelpers.cpp
+++ b/src/Subtitles/SubtitleHelpers.cpp
@@ -88,7 +88,7 @@ void Subtitle::GetSubFileNames(CString fn, const CAtlArray<CString>& paths, CAtl
extListSub.AppendChar(_T('|'));
}
}
- regExpSub.Format(_T("([%s]+.+)?\\.(%s)$"), separators, extListSub);
+ regExpSub.Format(_T("([%s]+.+)?\\.(%s)$"), separators, extListSub.GetString());
regExpVid.Format(_T(".+\\.(%s)$"), extListVid);
const std::wregex::flag_type reFlags = std::wregex::icase | std::wregex::optimize;
@@ -264,7 +264,7 @@ CString Subtitle::GuessSubtitleName(const CString& fn, CString videoName, LCID&
name = fn.Mid(fn.ReverseFind('\\') + 1);
if (name.GetLength() > 100) { // Cut some part of the filename if it's too long
- name.Format(_T("%s...%s"), name.Left(50).TrimRight(_T(".-_ ")), name.Right(50).TrimLeft(_T(".-_ ")));
+ name.Format(_T("%s...%s"), name.Left(50).TrimRight(_T(".-_ ")).GetString(), name.Right(50).TrimLeft(_T(".-_ ")).GetString());
}
return name;
diff --git a/src/Subtitles/VobSubFile.cpp b/src/Subtitles/VobSubFile.cpp
index c8045ae28..cd2ba19e9 100644
--- a/src/Subtitles/VobSubFile.cpp
+++ b/src/Subtitles/VobSubFile.cpp
@@ -1056,7 +1056,7 @@ bool CVobSubFile::WriteIdx(CString fn, int delay)
continue;
}
- str.Format(_T("# %s\n"), sl.name);
+ str.Format(_T("# %s\n"), sl.name.GetString());
f.WriteString(str);
ASSERT(sl.id);
@@ -1068,7 +1068,7 @@ bool CVobSubFile::WriteIdx(CString fn, int delay)
str = _T("# Uncomment next line to activate alternative name in VSFilter / Windows Media Player 6.x\n");
f.WriteString(str);
- str.Format(_T("alt: %s\n"), sl.alt);
+ str.Format(_T("alt: %s\n"), sl.alt.GetString());
if (sl.name == sl.alt) {
str = _T("# ") + str;
}
@@ -1824,11 +1824,11 @@ bool CVobSubFile::SaveWinSubMux(CString fn, int delay)
}
CString bmpfn;
- bmpfn.Format(_T("%s_%06Iu.bmp"), fn, i + 1);
+ bmpfn.Format(_T("%s_%06Iu.bmp"), fn.GetString(), i + 1);
CString str;
str.Format(_T("%s\t%02d:%02d:%02d:%02d %02d:%02d:%02d:%02d\t%03d %03d %03d %03d %d %d %d %d\n"),
- bmpfn,
+ bmpfn.GetString(),
t1 / 1000 / 60 / 60, (t1 / 1000 / 60) % 60, (t1 / 1000) % 60, (t1 % 1000) / 10,
t2 / 1000 / 60 / 60, (t2 / 1000 / 60) % 60, (t2 / 1000) % 60, (t2 % 1000) / 10,
m_img.rect.Width(), m_img.rect.Height(), m_img.rect.left, m_img.rect.top,
@@ -1911,8 +1911,8 @@ bool CVobSubFile::SaveScenarist(CString fn, int delay)
!m_bOnlyShowForcedSubs ? _T("non_forced") : _T("forced"),
m_size.cy == 480 ? _T("NTSC") : _T("PAL"),
m_size.cy - 3,
- fullpath,
- title,
+ fullpath.GetString(),
+ title.GetString(),
m_size.cy == 480 ? 479 : 574);
f.WriteString(str2);
@@ -2018,7 +2018,7 @@ bool CVobSubFile::SaveScenarist(CString fn, int delay)
}
CString bmpfn;
- bmpfn.Format(_T("%s_%04Iu.bmp"), fn, i + 1);
+ bmpfn.Format(_T("%s_%04Iu.bmp"), fn.GetString(), i + 1);
title = bmpfn.Mid(bmpfn.ReverseFind('/') + 1);
// E1, E2, P, Bg
@@ -2104,7 +2104,7 @@ bool CVobSubFile::SaveScenarist(CString fn, int delay)
++k,
h1, m1, s1, f1,
h2, m2, s2, f2,
- title);
+ title.GetString());
f.WriteString(str);
CFile bmp;
@@ -2166,8 +2166,8 @@ bool CVobSubFile::SaveMaestro(CString fn, int delay)
!m_bOnlyShowForcedSubs ? _T("non_forced") : _T("forced"),
m_size.cy == 480 ? _T("NTSC") : _T("PAL"),
m_size.cy - 3,
- fullpath,
- title,
+ fullpath.GetString(),
+ title.GetString(),
m_size.cy == 480 ? 479 : 574);
f.WriteString(str2);
@@ -2248,7 +2248,7 @@ bool CVobSubFile::SaveMaestro(CString fn, int delay)
}
CString bmpfn;
- bmpfn.Format(_T("%s_%04Iu.bmp"), fn, i + 1);
+ bmpfn.Format(_T("%s_%04Iu.bmp"), fn.GetString(), i + 1);
title = bmpfn.Mid(bmpfn.ReverseFind('/') + 1);
// E1, E2, P, Bg
@@ -2332,7 +2332,7 @@ bool CVobSubFile::SaveMaestro(CString fn, int delay)
++k,
h1, m1, s1, f1,
h2, m2, s2, f2,
- title);
+ title.GetString());
f.WriteString(str);
CFile bmp;
diff --git a/src/Subtitles/VobSubFileRipper.cpp b/src/Subtitles/VobSubFileRipper.cpp
index c58566823..160670b3c 100644
--- a/src/Subtitles/VobSubFileRipper.cpp
+++ b/src/Subtitles/VobSubFileRipper.cpp
@@ -378,7 +378,7 @@ bool CVobSubFileRipper::LoadVob(CString fn)
}
if (vobs.GetCount() <= 0) {
- Log(LOG_ERROR, _T("Nothing found! (%s*.vob)"), fn);
+ Log(LOG_ERROR, _T("Nothing found! (%s*.vob)"), fn.GetString());
return false;
}
diff --git a/src/filters/PinInfoWnd.cpp b/src/filters/PinInfoWnd.cpp
index 6e92daa78..9964b8448 100644
--- a/src/filters/PinInfoWnd.cpp
+++ b/src/filters/PinInfoWnd.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2016 see Authors.txt
+ * (C) 2006-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -202,7 +202,7 @@ void CPinInfoWnd::OnSelectedPinChange()
} else {
strName = filterInfo.achName;
}
- str.Format(_T("Filter : %s - CLSID : %s\n\n"), strName, CStringFromGUID(filterClsid));
+ str.Format(_T("Filter : %s - CLSID : %s\n\n"), strName.GetString(), CStringFromGUID(filterClsid).GetString());
AddLine(str);
}
}
@@ -212,9 +212,9 @@ void CPinInfoWnd::OnSelectedPinChange()
CComPtr<IPin> pPinTo;
if (SUCCEEDED(pPin->ConnectedTo(&pPinTo)) && pPinTo) {
str.Format(_T("- Connected to:\n\nCLSID: %s\nFilter: %s\nPin: %s\n\n"),
- CString(CStringFromGUID(GetCLSID(pPinTo))),
- CString(GetFilterName(GetFilterFromPin(pPinTo))),
- CString(GetPinName(pPinTo)));
+ CStringFromGUID(GetCLSID(pPinTo)).GetString(),
+ static_cast<LPCTSTR>(GetFilterName(GetFilterFromPin(pPinTo))),
+ static_cast<LPCTSTR>(GetPinName(pPinTo)));
AddLine(str);
diff --git a/src/filters/muxer/BaseMuxer/BaseMuxerOutputPin.cpp b/src/filters/muxer/BaseMuxer/BaseMuxerOutputPin.cpp
index 283478d30..764ba3b6c 100644
--- a/src/filters/muxer/BaseMuxer/BaseMuxerOutputPin.cpp
+++ b/src/filters/muxer/BaseMuxer/BaseMuxerOutputPin.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2013, 2015-2016 see Authors.txt
+ * (C) 2006-2013, 2015-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -301,7 +301,7 @@ void CBaseMuxerRawOutputPin::MuxPacket(const CMediaType& mt, const MuxerPacket*
pPacket->index + 1,
start.bHours, start.bMinutes, start.bSeconds, (int)((pPacket->rtStart / 10000) % 1000),
stop.bHours, stop.bMinutes, stop.bSeconds, (int)((pPacket->rtStop / 10000) % 1000),
- CStringA(str));
+ CStringA(str).GetString());
pBitStream->StrWrite(str, true);
@@ -342,11 +342,11 @@ void CBaseMuxerRawOutputPin::MuxPacket(const CMediaType& mt, const MuxerPacket*
}
str.Format("Dialogue: %s,%u:%02u:%02u.%02d,%u:%02u:%02u.%02d,%s,%s,%s,%s,%s,%s,%s\n",
- layer,
+ layer.GetString(),
start.bHours, start.bMinutes, start.bSeconds, (int)((pPacket->rtStart / 100000) % 100),
stop.bHours, stop.bMinutes, stop.bSeconds, (int)((pPacket->rtStop / 100000) % 100),
- style, actor, left, right, top, effect,
- CStringA(str));
+ style.GetString(), actor.GetString(), left.GetString(), right.GetString(), top.GetString(), effect.GetString(),
+ CStringA(str).GetString());
pBitStream->StrWrite(str, true);
diff --git a/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp
index add9ec42c..29cc9ffdf 100644
--- a/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp
@@ -784,7 +784,6 @@ HRESULT CEVRAllocatorPresenter::SetMediaType(IMFMediaType* pType)
{
HRESULT hr = S_OK;
AM_MEDIA_TYPE* pAMMedia = nullptr;
- CString strTemp, strTemp1;
CHECK_HR(CheckShutdown());
@@ -810,11 +809,11 @@ HRESULT CEVRAllocatorPresenter::SetMediaType(IMFMediaType* pType)
CAutoLock lock(&m_MediaTypeLock);
m_pMediaType = pType;
- strTemp = GetMediaTypeName(pAMMedia->subtype);
+ CString strTemp = GetMediaTypeName(pAMMedia->subtype);
strTemp.Replace(L"MEDIASUBTYPE_", L"");
- strTemp1 = GetMediaTypeFormatDesc(pType);
+ CString strTemp1 = GetMediaTypeFormatDesc(pType);
strTemp1.Replace(L"D3DFMT_", L"");
- m_strStatsMsg[MSG_MIXEROUT].Format(L"Mixer output : %-10s Type %-10s", strTemp, strTemp1);
+ m_strStatsMsg[MSG_MIXEROUT].Format(L"Mixer output : %-10s Type %-10s", strTemp.GetString(), strTemp1.GetString());
}
pType->FreeRepresentation(FORMAT_VideoInfo2, (void*)pAMMedia);
diff --git a/src/filters/renderer/VideoRenderers/IPinHook.cpp b/src/filters/renderer/VideoRenderers/IPinHook.cpp
index 209442e18..fa8dea11d 100644
--- a/src/filters/renderer/VideoRenderers/IPinHook.cpp
+++ b/src/filters/renderer/VideoRenderers/IPinHook.cpp
@@ -766,7 +766,7 @@ static HRESULT STDMETHODCALLTYPE GetVideoAcceleratorGUIDsMine(IAMVideoAccelerato
if (pGuidsSupported) {
for (DWORD i = 0; i < *pdwNumGuidsSupported; i++) {
- LOG(_T("[out] pGuidsSupported[%d] = %s"), i, CStringFromGUID(pGuidsSupported[i]));
+ LOG(_T("[out] pGuidsSupported[%d] = %s"), i, CStringFromGUID(pGuidsSupported[i]).GetString());
}
}
}
@@ -779,7 +779,7 @@ static HRESULT STDMETHODCALLTYPE GetUncompFormatsSupportedMine(IAMVideoAccelerat
LOG(_T("\nGetUncompFormatsSupported"));
if (pGuid) {
- LOG(_T("[in] *pGuid = %s"), CStringFromGUID(*pGuid));
+ LOG(_T("[in] *pGuid = %s"), CStringFromGUID(*pGuid).GetString());
}
if (pdwNumFormatsSupported) {
@@ -820,7 +820,7 @@ static HRESULT STDMETHODCALLTYPE GetCompBufferInfoMine(IAMVideoAcceleratorC* Thi
g_nDXVAVersion = 1;
#ifdef _DEBUG
- LOG(_T("[in] *pGuid = %s"), CStringFromGUID(*pGuid));
+ LOG(_T("[in] *pGuid = %s"), CStringFromGUID(*pGuid).GetString());
if (pdwNumTypesCompBuffers) {
LOG(_T("[in] *pdwNumTypesCompBuffers = %d"), *pdwNumTypesCompBuffers);
@@ -967,9 +967,9 @@ static HRESULT STDMETHODCALLTYPE ExecuteMine(IAMVideoAcceleratorC* This, DWORD d
LOG(_T(" ConfigRequested->bConfigSpatialResidInterleaved= %d"), ConfigRequested->bConfigSpatialResidInterleaved);
LOG(_T(" ConfigRequested->bConfigSpecificIDCT = %d"), ConfigRequested->bConfigSpecificIDCT);
LOG(_T(" ConfigRequested->dwFunction = %d"), ConfigRequested->dwFunction);
- LOG(_T(" ConfigRequested->guidConfigBitstreamEncryption = %s"), CStringFromGUID(ConfigRequested->guidConfigBitstreamEncryption));
- LOG(_T(" ConfigRequested->guidConfigMBcontrolEncryption = %s"), CStringFromGUID(ConfigRequested->guidConfigMBcontrolEncryption));
- LOG(_T(" ConfigRequested->guidConfigResidDiffEncryption = %s"), CStringFromGUID(ConfigRequested->guidConfigResidDiffEncryption));
+ LOG(_T(" ConfigRequested->guidConfigBitstreamEncryption = %s"), CStringFromGUID(ConfigRequested->guidConfigBitstreamEncryption).GetString());
+ LOG(_T(" ConfigRequested->guidConfigMBcontrolEncryption = %s"), CStringFromGUID(ConfigRequested->guidConfigMBcontrolEncryption).GetString());
+ LOG(_T(" ConfigRequested->guidConfigResidDiffEncryption = %s"), CStringFromGUID(ConfigRequested->guidConfigResidDiffEncryption).GetString());
} else
LOG(_T("[in] lpPrivateInputData = %02x %02x %02x %02x ..."),
((BYTE*)lpPrivateInputData)[0],
@@ -1408,9 +1408,9 @@ static void LogDXVA2Config(const DXVA2_ConfigPictureDecode* pConfig)
LOG(_T(" - ConfigSpatialResid8 %u"), pConfig->ConfigSpatialResid8);
LOG(_T(" - ConfigSpatialResidInterleaved %u"), pConfig->ConfigSpatialResidInterleaved);
LOG(_T(" - ConfigSpecificIDCT %u"), pConfig->ConfigSpecificIDCT);
- LOG(_T(" - guidConfigBitstreamEncryption %s"), CStringFromGUID(pConfig->guidConfigBitstreamEncryption));
- LOG(_T(" - guidConfigMBcontrolEncryption %s"), CStringFromGUID(pConfig->guidConfigMBcontrolEncryption));
- LOG(_T(" - guidConfigResidDiffEncryption %s"), CStringFromGUID(pConfig->guidConfigResidDiffEncryption));
+ LOG(_T(" - guidConfigBitstreamEncryption %s"), CStringFromGUID(pConfig->guidConfigBitstreamEncryption).GetString());
+ LOG(_T(" - guidConfigMBcontrolEncryption %s"), CStringFromGUID(pConfig->guidConfigMBcontrolEncryption).GetString());
+ LOG(_T(" - guidConfigResidDiffEncryption %s"), CStringFromGUID(pConfig->guidConfigResidDiffEncryption).GetString());
}
static void LogDXVA2VideoDesc(const DXVA2_VideoDesc* pVideoDesc)
diff --git a/src/filters/renderer/VideoRenderers/SyncRenderer.cpp b/src/filters/renderer/VideoRenderers/SyncRenderer.cpp
index 8c884b348..ef8a2363e 100644
--- a/src/filters/renderer/VideoRenderers/SyncRenderer.cpp
+++ b/src/filters/renderer/VideoRenderers/SyncRenderer.cpp
@@ -659,7 +659,7 @@ HRESULT CBaseAP::CreateDXDevice(CString& _Error)
}
if (FAILED(hr)) {
- _Error.AppendFormat(_T("CreateDevice failed: %s\n"), GetWindowsErrorMessage(hr, m_hD3D9));
+ _Error.AppendFormat(_T("CreateDevice failed: %s\n"), GetWindowsErrorMessage(hr, m_hD3D9).GetString());
return hr;
}
@@ -2985,7 +2985,7 @@ HRESULT CSyncAP::CreateOptimalOutputType(IMFMediaType* pMixerProposedType, IMFMe
for (REFGUID guidKey : colorAttributes) {
if (FAILED(hr = copyAttribute(pMixerInputType, pOptimalMediaType, guidKey))) {
- TRACE(_T("Copying color attribute %s failed: 0x%08x\n"), CComBSTR(guidKey), hr);
+ TRACE(_T("Copying color attribute %s failed: 0x%08x\n"), static_cast<LPCTSTR>(CComBSTR(guidKey)), hr);
}
}
@@ -3074,7 +3074,7 @@ HRESULT CSyncAP::SetMediaType(IMFMediaType* pType)
strTemp = GetMediaTypeName(pAMMedia->subtype);
strTemp.Replace(L"MEDIASUBTYPE_", L"");
- m_strStatsMsg[MSG_MIXEROUT].Format(L"Mixer output : %s", strTemp);
+ m_strStatsMsg[MSG_MIXEROUT].Format(L"Mixer output : %s", strTemp.GetString());
}
pType->FreeRepresentation(FORMAT_VideoInfo2, (void*)pAMMedia);
diff --git a/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp
index 430f32f74..c7d94daab 100644
--- a/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/VMR9AllocatorPresenter.cpp
@@ -406,7 +406,7 @@ STDMETHODIMP CVMR9AllocatorPresenter::PresentImage(DWORD_PTR dwUserID, VMR9Prese
if (lpPresInfo->rtEnd <= lpPresInfo->rtStart) {
TRACE(_T("VMR9: Invalid timestamps (%s - %s). The timestamp from the pin hook will be used anyway (%s).\n"),
- ReftimeToString(lpPresInfo->rtStart), ReftimeToString(lpPresInfo->rtEnd), ReftimeToString(g_tSampleStart));
+ ReftimeToString(lpPresInfo->rtStart).GetString(), ReftimeToString(lpPresInfo->rtEnd).GetString(), ReftimeToString(g_tSampleStart).GetString());
}
if (m_pSubPicQueue) {
diff --git a/src/filters/source/SubtitleSource/SubtitleSource.cpp b/src/filters/source/SubtitleSource/SubtitleSource.cpp
index f9f927ab7..ee9a0a879 100644
--- a/src/filters/source/SubtitleSource/SubtitleSource.cpp
+++ b/src/filters/source/SubtitleSource/SubtitleSource.cpp
@@ -510,9 +510,9 @@ HRESULT CSubtitleStream::FillBuffer(IMediaSample* pSample)
} else if (m_mt.majortype == MEDIATYPE_Subtitle && (m_mt.subtype == MEDIASUBTYPE_SSA || m_mt.subtype == MEDIASUBTYPE_ASS)) {
CStringW line;
line.Format(L"%d,%d,%s,%s,%d,%d,%d,%s,%s",
- stse.readorder, stse.layer, CStringW(stse.style), CStringW(stse.actor),
+ stse.readorder, stse.layer, stse.style.GetString(), stse.actor.GetString(),
stse.marginRect.left, stse.marginRect.right, (stse.marginRect.top + stse.marginRect.bottom) / 2,
- CStringW(stse.effect), m_rts.GetStrW(m_nPosition, true));
+ stse.effect.GetString(), m_rts.GetStrW(m_nPosition, true).GetString());
CStringA str = UTF16To8(line);
memcpy((char*)pData, str, len = str.GetLength());
diff --git a/src/filters/transform/VSFilter/plugins.cpp b/src/filters/transform/VSFilter/plugins.cpp
index 1f1acd989..430179ea6 100644
--- a/src/filters/transform/VSFilter/plugins.cpp
+++ b/src/filters/transform/VSFilter/plugins.cpp
@@ -304,7 +304,7 @@ namespace Plugin
bool FssProc(FilterActivation* fa, const FilterFunctions* ff, char* buf, int buflen) {
CStringA fn(GetFileName());
fn.Replace("\\", "\\\\");
- _snprintf_s(buf, buflen, buflen, "Config(\"%s\")", fn);
+ _snprintf_s(buf, buflen, buflen, "Config(\"%s\")", fn.GetString());
return true;
}
};
@@ -337,7 +337,7 @@ namespace Plugin
void StringProc(const FilterActivation* fa, const FilterFunctions* ff, char* str) {
if (!GetFileName().IsEmpty()) {
- sprintf_s(str, STRING_PROC_BUFFER_SIZE, " (%s, %d)", CStringA(GetFileName()), GetCharSet());
+ sprintf_s(str, STRING_PROC_BUFFER_SIZE, " (%s, %d)", CStringA(GetFileName()).GetString(), GetCharSet());
} else {
sprintf_s(str, STRING_PROC_BUFFER_SIZE, " (empty)");
}
@@ -346,7 +346,7 @@ namespace Plugin
bool FssProc(FilterActivation* fa, const FilterFunctions* ff, char* buf, int buflen) {
CStringA fn(GetFileName());
fn.Replace("\\", "\\\\");
- _snprintf_s(buf, buflen, buflen, "Config(\"%s\", %d)", fn, GetCharSet());
+ _snprintf_s(buf, buflen, buflen, "Config(\"%s\", %d)", fn.GetString(), GetCharSet());
return true;
}
};
diff --git a/src/mpc-hc/AboutDlg.cpp b/src/mpc-hc/AboutDlg.cpp
index 7c1f89d28..1363de0b6 100644
--- a/src/mpc-hc/AboutDlg.cpp
+++ b/src/mpc-hc/AboutDlg.cpp
@@ -253,7 +253,7 @@ void CAboutDlg::OnCopyToClipboard()
if (key.QueryStringValue(_T("ProcessorNameString"), cpuName.GetBuffer(nChars), &nChars) == ERROR_SUCCESS) {
cpuName.ReleaseBuffer(nChars);
cpuName.Trim();
- info.AppendFormat(_T(" CPU: %s\r\n"), cpuName);
+ info.AppendFormat(_T(" CPU: %s\r\n"), cpuName.GetString());
}
}
}
@@ -268,13 +268,13 @@ void CAboutDlg::OnCopyToClipboard()
deviceName.Trim();
if (adapterCount > 1) {
- info.AppendFormat(_T(" GPU%u: %s"), adapter + 1, deviceName);
+ info.AppendFormat(_T(" GPU%u: %s"), adapter + 1, deviceName.GetString());
} else {
- info.AppendFormat(_T(" GPU: %s"), deviceName);
+ info.AppendFormat(_T(" GPU: %s"), deviceName.GetString());
}
if (adapterIdentifier.DriverVersion.QuadPart) {
info.AppendFormat(_T(" (driver version: %s)"),
- FileVersionInfo::FormatVersionString(adapterIdentifier.DriverVersion.LowPart, adapterIdentifier.DriverVersion.HighPart));
+ FileVersionInfo::FormatVersionString(adapterIdentifier.DriverVersion.LowPart, adapterIdentifier.DriverVersion.HighPart).GetString());
}
info += _T("\r\n");
}
diff --git a/src/mpc-hc/AppSettings.cpp b/src/mpc-hc/AppSettings.cpp
index c60c6a260..088a118e7 100644
--- a/src/mpc-hc/AppSettings.cpp
+++ b/src/mpc-hc/AppSettings.cpp
@@ -964,7 +964,7 @@ void CAppSettings::SaveSettings()
str.Format(_T("CommandMod%d"), i);
CString str2;
str2.Format(_T("%hu %hx %hx \"%S\" %d %hhu %u %hhu"),
- wc.cmd, (WORD)wc.fVirt, wc.key, wc.rmcmd,
+ wc.cmd, (WORD)wc.fVirt, wc.key, wc.rmcmd.GetString(),
wc.rmrepcnt, wc.mouse, wc.appcmd, wc.mouseFS);
pApp->WriteProfileString(IDS_R_COMMANDS, str, str2);
i++;
@@ -1763,7 +1763,7 @@ void CAppSettings::LoadSettings()
m_DVBChannels.emplace_back(strChannel);
} catch (CException* e) {
// The tokenisation can fail if the input string was invalid
- TRACE(_T("Failed to parse a DVB channel from string \"%s\""), strChannel);
+ TRACE(_T("Failed to parse a DVB channel from string \"%s\""), strChannel.GetString());
ASSERT(FALSE);
e->Delete();
}
diff --git a/src/mpc-hc/CmdLineHelpDlg.cpp b/src/mpc-hc/CmdLineHelpDlg.cpp
index a0c42c2e8..6bc0cf714 100644
--- a/src/mpc-hc/CmdLineHelpDlg.cpp
+++ b/src/mpc-hc/CmdLineHelpDlg.cpp
@@ -52,9 +52,9 @@ BOOL CmdLineHelpDlg::OnInitDialog()
if (!m_cmdLine.IsEmpty()) {
m_text.LoadString(IDS_UNKNOWN_SWITCH);
- m_text.AppendFormat(_T("%s\n\n"), m_cmdLine);
+ m_text.AppendFormat(_T("%s\n\n"), m_cmdLine.GetString());
}
- m_text.AppendFormat(_T("%s\n"), ResStr(IDS_USAGE));
+ m_text.AppendFormat(_T("%s\n"), ResStr(IDS_USAGE).GetString());
constexpr int cmdArgs[] = {
IDS_CMD_PATHNAME, IDS_CMD_DUB, IDS_CMD_DUBDELAY, IDS_CMD_D3DFS, IDS_CMD_SUB,
diff --git a/src/mpc-hc/DVBChannel.cpp b/src/mpc-hc/DVBChannel.cpp
index 393d35c77..a41a269aa 100644
--- a/src/mpc-hc/DVBChannel.cpp
+++ b/src/mpc-hc/DVBChannel.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2009-2016 see Authors.txt
+ * (C) 2009-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -129,11 +129,11 @@ CString CDVBChannel::ToString() const
m_nDefaultSubtitle);
for (int i = 0; i < m_nAudioCount; i++) {
- strValue.AppendFormat(_T("|%lu|%d|%d|%s"), m_Audios[i].ulPID, m_Audios[i].nType, m_Audios[i].nPesType, substituteEmpty(m_Audios[i].sLanguage));
+ strValue.AppendFormat(_T("|%lu|%d|%d|%s"), m_Audios[i].ulPID, m_Audios[i].nType, m_Audios[i].nPesType, substituteEmpty(m_Audios[i].sLanguage).GetString());
}
for (int i = 0; i < m_nSubtitleCount; i++) {
- strValue.AppendFormat(_T("|%lu|%d|%d|%s"), m_Subtitles[i].ulPID, m_Subtitles[i].nType, m_Subtitles[i].nPesType, substituteEmpty(m_Subtitles[i].sLanguage));
+ strValue.AppendFormat(_T("|%lu|%d|%d|%s"), m_Subtitles[i].ulPID, m_Subtitles[i].nType, m_Subtitles[i].nPesType, substituteEmpty(m_Subtitles[i].sLanguage).GetString());
}
strValue.AppendFormat(_T("|%d|%d|%lu|%lu|%d"),
@@ -151,7 +151,7 @@ CStringA CDVBChannel::ToJSON() const
CStringA jsonChannel;
jsonChannel.Format("{ \"index\" : %d, \"name\" : \"%s\" }",
m_nPrefNumber,
- EscapeJSONString(UTF16To8(m_strName)));
+ EscapeJSONString(UTF16To8(m_strName)).GetString());
return jsonChannel;
}
diff --git a/src/mpc-hc/EditListEditor.cpp b/src/mpc-hc/EditListEditor.cpp
index 6a3cf5751..afaa936c8 100644
--- a/src/mpc-hc/EditListEditor.cpp
+++ b/src/mpc-hc/EditListEditor.cpp
@@ -186,7 +186,7 @@ void CEditListEditor::SaveEditListToFile()
CClip& CurClip = m_editList.GetAt(pos);
if (CurClip.HaveIn() && CurClip.HaveOut()) {
- strLine.Format(_T("%s\t%s\t%s\t%s\t%s\n"), CurClip.GetIn(), CurClip.GetOut(), CurClip.GetName(), strUser, strHotFolders);
+ strLine.Format(_T("%s\t%s\t%s\t%s\t%s\n"), CurClip.GetIn().GetString(), CurClip.GetOut().GetString(), CurClip.GetName().GetString(), strUser.GetString(), strHotFolders.GetString());
editListFile.WriteString(strLine);
}
}
diff --git a/src/mpc-hc/FGFilter.cpp b/src/mpc-hc/FGFilter.cpp
index 3bcfe0577..00eb83f02 100644
--- a/src/mpc-hc/FGFilter.cpp
+++ b/src/mpc-hc/FGFilter.cpp
@@ -550,7 +550,7 @@ void CFGFilterList::Insert(CFGFilter* pFGF, int group, bool exactmatch, bool aut
bool bInsert = true;
TRACE(_T("FGM: Inserting %d %d %016I64x '%s' --> "), group, exactmatch, pFGF->GetMerit(),
- pFGF->GetName().IsEmpty() ? CStringFromGUID(pFGF->GetCLSID()) : CString(pFGF->GetName()));
+ pFGF->GetName().IsEmpty() ? CStringFromGUID(pFGF->GetCLSID()).GetString() : CString(pFGF->GetName()).GetString());
CFGFilterRegistry* pFGFR = dynamic_cast<CFGFilterRegistry*>(pFGF);
@@ -619,7 +619,7 @@ POSITION CFGFilterList::GetHeadPosition()
POSITION pos = m_sortedfilters.GetHeadPosition();
while (pos) {
CFGFilter* pFGF = m_sortedfilters.GetNext(pos);
- TRACE(_T("FGM: - %016I64x '%s'\n"), pFGF->GetMerit(), pFGF->GetName().IsEmpty() ? CStringFromGUID(pFGF->GetCLSID()) : CString(pFGF->GetName()));
+ TRACE(_T("FGM: - %016I64x '%s'\n"), pFGF->GetMerit(), pFGF->GetName().IsEmpty() ? CStringFromGUID(pFGF->GetCLSID()).GetString() : CString(pFGF->GetName()).GetString());
}
#endif
diff --git a/src/mpc-hc/FGFilterLAV.cpp b/src/mpc-hc/FGFilterLAV.cpp
index ff14afe27..b0e846c1c 100644
--- a/src/mpc-hc/FGFilterLAV.cpp
+++ b/src/mpc-hc/FGFilterLAV.cpp
@@ -140,7 +140,7 @@ CString CFGFilterLAV::GetVersion(LAVFILTER_TYPE filterType /*= INVALID*/)
if (uiVersionMin != UINT64_MAX) {
version = strVersionMin;
if (uiVersionMax != uiVersionMin) {
- version.AppendFormat(_T(" - %s"), strVersionMax);
+ version.AppendFormat(_T(" - %s"), strVersionMax.GetString());
}
}
diff --git a/src/mpc-hc/FGManager.cpp b/src/mpc-hc/FGManager.cpp
index 5d537871d..c2a430ba8 100644
--- a/src/mpc-hc/FGManager.cpp
+++ b/src/mpc-hc/FGManager.cpp
@@ -389,7 +389,7 @@ HRESULT CFGManager::EnumSourceFilters(LPCWSTR lpcwstrFileName, CFGFilterList& fl
HRESULT CFGManager::AddSourceFilter(CFGFilter* pFGF, LPCWSTR lpcwstrFileName, LPCWSTR lpcwstrFilterName, IBaseFilter** ppBF)
{
- TRACE(_T("FGM: AddSourceFilter trying '%s'\n"), CStringFromGUID(pFGF->GetCLSID()));
+ TRACE(_T("FGM: AddSourceFilter trying '%s'\n"), CStringFromGUID(pFGF->GetCLSID()).GetString());
CheckPointer(lpcwstrFileName, E_POINTER);
CheckPointer(ppBF, E_POINTER);
@@ -747,7 +747,7 @@ HRESULT CFGManager::Connect(IPin* pPinOut, IPin* pPinIn, bool bContinueRender)
pFGF = pMadVRAllocatorPresenter;
}
- TRACE(_T("FGM: Connecting '%s'\n"), pFGF->GetName());
+ TRACE(_T("FGM: Connecting '%s'\n"), pFGF->GetName().GetString());
CComPtr<IBaseFilter> pBF;
CInterfaceList<IUnknown, &IID_IUnknown> pUnks;
@@ -1342,7 +1342,7 @@ STDMETHODIMP CFGManager::GetDeadEnd(int iIndex, CAtlList<CStringW>& path, CAtlLi
const path_t& p = m_deadends[iIndex]->GetNext(pos);
CStringW str;
- str.Format(L"%s::%s", p.filter, p.pin);
+ str.Format(L"%s::%s", p.filter.GetString(), p.pin.GetString());
path.AddTail(str);
}
diff --git a/src/mpc-hc/FileAssoc.cpp b/src/mpc-hc/FileAssoc.cpp
index 032d7318a..56d8aa46f 100644
--- a/src/mpc-hc/FileAssoc.cpp
+++ b/src/mpc-hc/FileAssoc.cpp
@@ -240,7 +240,7 @@ bool CFileAssoc::Register(CString ext, CString strLabel, bool bRegister, bool bR
/* icon_index value -1 means no icon was found in the iconlib for the file extension */
if (iconIndex >= 0 && ExtractIcon(AfxGetApp()->m_hInstance, m_iconLibPath, iconIndex)) {
- appIcon.Format(_T("\"%s\",%d"), m_iconLibPath, iconIndex);
+ appIcon.Format(_T("\"%s\",%d"), m_iconLibPath.GetString(), iconIndex);
}
}
@@ -739,7 +739,7 @@ bool CFileAssoc::ReAssocIcons(const CAtlList<CString>& exts)
/* icon_index value -1 means no icon was found in the iconlib for the file extension */
if (iconIndex >= 0 && ExtractIcon(AfxGetApp()->m_hInstance, m_iconLibPath, iconIndex)) {
- appIcon.Format(_T("\"%s\",%d"), m_iconLibPath, iconIndex);
+ appIcon.Format(_T("\"%s\",%d"), m_iconLibPath.GetString(), iconIndex);
}
/* no icon was found for the file extension, so use MPC-HC's icon */
diff --git a/src/mpc-hc/MainFrm.cpp b/src/mpc-hc/MainFrm.cpp
index d207ead9f..2337937f7 100644
--- a/src/mpc-hc/MainFrm.cpp
+++ b/src/mpc-hc/MainFrm.cpp
@@ -1906,7 +1906,7 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent)
int tmp, tmp1;
if (SUCCEEDED(m_pQP->get_AvgFrameRate(&tmp))) { // We hang here due to a lock that never gets released.
- info.Format(_T("%d.%02d (%s)"), tmp / 100, tmp % 100, rate);
+ info.Format(_T("%d.%02d (%s)"), tmp / 100, tmp % 100, rate.GetString());
} else {
info = _T("-");
}
@@ -2071,12 +2071,12 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent)
CString format = GetDVDAudioFormatName(AATR);
Audio.Format(IDS_MAINFRM_11,
- lang,
- format,
+ lang.GetString(),
+ format.GetString(),
AATR.dwFrequency,
AATR.bQuantization,
AATR.bNumberOfChannels,
- ResStr(AATR.bNumberOfChannels > 1 ? IDS_MAINFRM_13 : IDS_MAINFRM_12));
+ ResStr(AATR.bNumberOfChannels > 1 ? IDS_MAINFRM_13 : IDS_MAINFRM_12).GetString());
m_wndStatusBar.SetStatusBitmap(
AATR.bNumberOfChannels == 1 ? IDB_AUDIOTYPE_MONO
@@ -2140,7 +2140,7 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent)
}
Subtitles.Format(_T("%s"),
- lang);
+ lang.GetString());
}
m_wndInfoBar.SetLine(StrRes(IDS_INFOBAR_SUBTITLES), Subtitles);
@@ -2451,7 +2451,7 @@ LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam)
Domain = _T("First Play");
if (s.fShowDebugInfo) {
- m_OSD.DebugMessage(_T("%s"), Domain);
+ m_OSD.DebugMessage(_T("%s"), Domain.GetString());
}
if (m_pDVDI && SUCCEEDED(m_pDVDI->GetDiscID(nullptr, &llDVDGuid))) {
@@ -2561,19 +2561,19 @@ LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam)
case DVD_DOMAIN_VideoManagerMenu:
Domain = _T("Video Manager Menu");
if (s.fShowDebugInfo) {
- m_OSD.DebugMessage(_T("%s"), Domain);
+ m_OSD.DebugMessage(_T("%s"), Domain.GetString());
}
break;
case DVD_DOMAIN_VideoTitleSetMenu:
Domain = _T("Video Title Set Menu");
if (s.fShowDebugInfo) {
- m_OSD.DebugMessage(_T("%s"), Domain);
+ m_OSD.DebugMessage(_T("%s"), Domain.GetString());
}
break;
case DVD_DOMAIN_Title:
Domain.Format(IDS_AG_TITLE, m_iDVDTitle);
if (s.fShowDebugInfo) {
- m_OSD.DebugMessage(_T("%s"), Domain);
+ m_OSD.DebugMessage(_T("%s"), Domain.GetString());
}
{
DVD_POSITION* dvdPosition = s.dvdPositions.GetLatestEntry();
@@ -2585,13 +2585,13 @@ LRESULT CMainFrame::OnGraphNotify(WPARAM wParam, LPARAM lParam)
case DVD_DOMAIN_Stop:
Domain.LoadString(IDS_AG_STOP);
if (s.fShowDebugInfo) {
- m_OSD.DebugMessage(_T("%s"), Domain);
+ m_OSD.DebugMessage(_T("%s"), Domain.GetString());
}
break;
default:
Domain = _T("-");
if (s.fShowDebugInfo) {
- m_OSD.DebugMessage(_T("%s"), Domain);
+ m_OSD.DebugMessage(_T("%s"), Domain.GetString());
}
break;
}
@@ -3228,7 +3228,7 @@ void CMainFrame::OnUpdatePlayerStatus(CCmdUI* pCmdUI)
}
if (m_bUsingDXVA && (msg == ResStr(IDS_CONTROLS_PAUSED) || msg == ResStr(IDS_CONTROLS_PLAYING))) {
- msg.AppendFormat(_T(" %s"), ResStr(IDS_HW_INDICATOR));
+ msg.AppendFormat(_T(" %s"), ResStr(IDS_HW_INDICATOR).GetString());
}
m_wndStatusBar.SetStatusMessage(msg);
} else if (GetLoadState() == MLS::CLOSING) {
@@ -3665,16 +3665,16 @@ void CMainFrame::OnDvdAudio(UINT nID)
if (!format.IsEmpty()) {
str.Format(IDS_MAINFRM_11,
- lang,
- format,
+ lang.GetString(),
+ format.GetString(),
AATR.dwFrequency,
AATR.bQuantization,
AATR.bNumberOfChannels,
- ResStr(AATR.bNumberOfChannels > 1 ? IDS_MAINFRM_13 : IDS_MAINFRM_12));
+ ResStr(AATR.bNumberOfChannels > 1 ? IDS_MAINFRM_13 : IDS_MAINFRM_12).GetString());
if (FAILED(hr)) {
str += _T(" [") + ResStr(IDS_AG_ERROR) + _T("] ");
}
- strMessage.Format(IDS_AUDIO_STREAM, str);
+ strMessage.Format(IDS_AUDIO_STREAM, str.GetString());
m_OSD.DisplayMessage(OSD_TOPLEFT, strMessage);
}
}
@@ -3720,7 +3720,7 @@ void CMainFrame::OnDvdSub(UINT nID)
if (FAILED(hr)) {
lang += _T(" [") + ResStr(IDS_AG_ERROR) + _T("] ");
}
- strMessage.Format(IDS_SUBTITLE_STREAM, lang);
+ strMessage.Format(IDS_SUBTITLE_STREAM, lang.GetString());
m_OSD.DisplayMessage(OSD_TOPLEFT, strMessage);
}
}
@@ -4255,7 +4255,7 @@ void CMainFrame::OnDropFiles(CAtlList<CString>& slFiles, DROPEFFECT dropEffect)
while (pos) {
CPath fn(slFiles.GetNext(pos));
fn.StripPath();
- filenames.AppendFormat(pos ? _T("%s, ") : _T("%s"), fn);
+ filenames.AppendFormat(pos ? _T("%s, ") : _T("%s"), static_cast<LPCTSTR>(fn));
}
SendStatusMessage(filenames + ResStr(IDS_SUB_LOADED_SUCCESS), 3000);
} else {
@@ -4810,7 +4810,7 @@ void CMainFrame::SaveThumbnails(LPCTSTR fn)
StrFormatByteSizeW(size, szFileSize, MAX_FILE_SIZE_BUFFER);
CString szByteSize;
szByteSize.Format(_T("%I64d"), size);
- fs.Format(IDS_THUMBNAILS_INFO_FILESIZE, szFileSize, FormatNumber(szByteSize));
+ fs.Format(IDS_THUMBNAILS_INFO_FILESIZE, szFileSize, FormatNumber(szByteSize).GetString());
}
CStringW ar;
@@ -4819,7 +4819,7 @@ void CMainFrame::SaveThumbnails(LPCTSTR fn)
}
str.Format(IDS_THUMBNAILS_INFO_HEADER,
- fnp, fs, szVideo.cx, szVideo.cy, ar, hmsf.bHours, hmsf.bMinutes, hmsf.bSeconds);
+ fnp.GetString(), fs.GetString(), szVideo.cx, szVideo.cy, ar.GetString(), hmsf.bHours, hmsf.bMinutes, hmsf.bSeconds);
rts.Add(str, true, 0, 1, _T("thumbs"));
rts.Render(spd, 0, 25, bbox);
@@ -4840,7 +4840,7 @@ static CString MakeSnapshotFileName(LPCTSTR prefix)
{
CTime t = CTime::GetCurrentTime();
CString fn;
- fn.Format(_T("%s_[%s]%s"), PathUtils::FilterInvalidCharsFromFileName(prefix), t.Format(_T("%Y.%m.%d_%H.%M.%S")), AfxGetAppSettings().strSnapshotExt);
+ fn.Format(_T("%s_[%s]%s"), PathUtils::FilterInvalidCharsFromFileName(prefix).GetString(), t.Format(_T("%Y.%m.%d_%H.%M.%S")).GetString(), AfxGetAppSettings().strSnapshotExt.GetString());
return fn;
}
@@ -4900,11 +4900,11 @@ void CMainFrame::OnFileSaveImage()
CStringW prefix = _T("snapshot");
if (GetPlaybackMode() == PM_FILE) {
- prefix.Format(_T("%s_snapshot_%s"), GetFileName(), GetVidPos());
+ prefix.Format(_T("%s_snapshot_%s"), GetFileName().GetString(), GetVidPos().GetString());
} else if (GetPlaybackMode() == PM_DVD) {
- prefix.Format(_T("dvd_snapshot_%s"), GetVidPos());
+ prefix.Format(_T("dvd_snapshot_%s"), GetVidPos().GetString());
} else if (GetPlaybackMode() == PM_DIGITAL_CAPTURE) {
- prefix.Format(_T("%s_snapshot"), m_pDVBState->sChannelName);
+ prefix.Format(_T("%s_snapshot"), m_pDVBState->sChannelName.GetString());
}
psrc.Combine(s.strSnapshotPath, MakeSnapshotFileName(prefix));
@@ -4968,15 +4968,15 @@ void CMainFrame::OnFileSaveImageAuto()
CStringW prefix = _T("snapshot");
if (GetPlaybackMode() == PM_FILE) {
- prefix.Format(_T("%s_snapshot_%s"), GetFileName(), GetVidPos());
+ prefix.Format(_T("%s_snapshot_%s"), GetFileName().GetString(), GetVidPos().GetString());
} else if (GetPlaybackMode() == PM_DVD) {
- prefix.Format(_T("dvd_snapshot_%s"), GetVidPos());
+ prefix.Format(_T("dvd_snapshot_%s"), GetVidPos().GetString());
} else if (GetPlaybackMode() == PM_DIGITAL_CAPTURE) {
- prefix.Format(_T("%s_snapshot"), m_pDVBState->sChannelName);
+ prefix.Format(_T("%s_snapshot"), m_pDVBState->sChannelName.GetString());
}
CString fn;
- fn.Format(_T("%s\\%s"), s.strSnapshotPath, MakeSnapshotFileName(prefix));
+ fn.Format(_T("%s\\%s"), s.strSnapshotPath.GetString(), MakeSnapshotFileName(prefix).GetString());
SaveImage(fn);
}
@@ -4998,7 +4998,7 @@ void CMainFrame::OnFileSaveThumbnails()
CPath psrc(s.strSnapshotPath);
CStringW prefix = _T("thumbs");
if (GetPlaybackMode() == PM_FILE) {
- prefix.Format(_T("%s_thumbs"), GetFileName());
+ prefix.Format(_T("%s_thumbs"), GetFileName().GetString());
} else {
ASSERT(FALSE);
}
@@ -5070,7 +5070,7 @@ void CMainFrame::OnFileSubtitlesLoad()
}
CString filters;
filters.Format(_T("%s|*.srt;*.sub;*.ssa;*.ass;*.smi;*.psb;*.txt;*.idx;*.usf;*.xss;*.rt;*.sup|%s"),
- ResStr(IDS_SUBTITLE_FILES_FILTER), ResStr(IDS_ALL_FILES_FILTER));
+ ResStr(IDS_SUBTITLE_FILES_FILTER).GetString(), ResStr(IDS_ALL_FILES_FILTER).GetString());
CFileDialog fd(TRUE, nullptr, nullptr, dwFlags, filters, GetModalParent());
@@ -6030,9 +6030,9 @@ void CMainFrame::OnViewOSDShowFileName()
if (SUCCEEDED(m_pDVDI->GetDVDDirectory(path.GetBuffer(MAX_PATH), MAX_PATH, &len)) && len) {
path.ReleaseBuffer();
if (path.Find(_T("\\VIDEO_TS")) == 2) {
- strOSD.AppendFormat(_T(" - %s"), GetDriveLabel(CPath(path)));
+ strOSD.AppendFormat(_T(" - %s"), GetDriveLabel(CPath(path)).GetString());
} else {
- strOSD.AppendFormat(_T(" - %s"), path);
+ strOSD.AppendFormat(_T(" - %s"), path.GetString());
}
}
}
@@ -7585,7 +7585,7 @@ void CMainFrame::OnPlayFiltersCopyToClipboard()
for (int i = 2, count = m_filtersMenu.GetMenuItemCount(); i < count; i++) {
CString filterName;
m_filtersMenu.GetMenuString(i, filterName, MF_BYPOSITION);
- filtersList.AppendFormat(_T(" - %s\r\n"), filterName);
+ filtersList.AppendFormat(_T(" - %s\r\n"), filterName.GetString());
}
// Allocate a global memory object for the text
@@ -7688,7 +7688,7 @@ void CMainFrame::OnPlayShadersPresetNext()
CString name;
if (s.m_Shaders.GetCurrentPresetName(name)) {
CString msg;
- msg.Format(IDS_OSD_SHADERS_PRESET, name);
+ msg.Format(IDS_OSD_SHADERS_PRESET, name.GetString());
m_OSD.DisplayMessage(OSD_TOPLEFT, msg);
}
}
@@ -7701,7 +7701,7 @@ void CMainFrame::OnPlayShadersPresetPrev()
CString name;
if (s.m_Shaders.GetCurrentPresetName(name)) {
CString msg;
- msg.Format(IDS_OSD_SHADERS_PRESET, name);
+ msg.Format(IDS_OSD_SHADERS_PRESET, name.GetString());
m_OSD.DisplayMessage(OSD_TOPLEFT, msg);
}
}
@@ -8011,7 +8011,7 @@ void CMainFrame::OnPlayColor(UINT nID)
brightness -= 1;
SetColorControl(ProcAmp_Brightness, brightness, contrast, hue, saturation);
tmp.Format(brightness ? _T("%+d") : _T("%d"), brightness);
- str.Format(IDS_OSD_BRIGHTNESS, tmp);
+ str.Format(IDS_OSD_BRIGHTNESS, tmp.GetString());
break;
case ID_COLOR_CONTRAST_INC:
@@ -8021,7 +8021,7 @@ void CMainFrame::OnPlayColor(UINT nID)
contrast -= 1;
SetColorControl(ProcAmp_Contrast, brightness, contrast, hue, saturation);
tmp.Format(contrast ? _T("%+d") : _T("%d"), contrast);
- str.Format(IDS_OSD_CONTRAST, tmp);
+ str.Format(IDS_OSD_CONTRAST, tmp.GetString());
break;
case ID_COLOR_HUE_INC:
@@ -8031,7 +8031,7 @@ void CMainFrame::OnPlayColor(UINT nID)
hue -= 1;
SetColorControl(ProcAmp_Hue, brightness, contrast, hue, saturation);
tmp.Format(hue ? _T("%+d") : _T("%d"), hue);
- str.Format(IDS_OSD_HUE, tmp);
+ str.Format(IDS_OSD_HUE, tmp.GetString());
break;
case ID_COLOR_SATURATION_INC:
@@ -8041,7 +8041,7 @@ void CMainFrame::OnPlayColor(UINT nID)
saturation -= 1;
SetColorControl(ProcAmp_Saturation, brightness, contrast, hue, saturation);
tmp.Format(saturation ? _T("%+d") : _T("%d"), saturation);
- str.Format(IDS_OSD_SATURATION, tmp);
+ str.Format(IDS_OSD_SATURATION, tmp.GetString());
break;
case ID_COLOR_RESET:
@@ -8292,8 +8292,8 @@ bool CMainFrame::SeekToFileChapter(int iChapter, bool bRelative /*= false*/)
CString strOSD;
strOSD.Format(_T("%s%s/%s %s%d/%u - \"%s\""),
- s.fRemainingTime ? _T("- ") : _T(""), ReftimeToString2(s.fRemainingTime ? rtDur - rt : rt), ReftimeToString2(rtDur),
- ResStr(IDS_AG_CHAPTER2), iChapter + 1, nChapters, name);
+ s.fRemainingTime ? _T("- ") : _T(""), ReftimeToString2(s.fRemainingTime ? rtDur - rt : rt).GetString(), ReftimeToString2(rtDur).GetString(),
+ ResStr(IDS_AG_CHAPTER2).GetString(), iChapter + 1, nChapters, static_cast<LPCTSTR>(name));
m_OSD.DisplayMessage(OSD_TOPLEFT, strOSD, 3000);
}
}
@@ -8382,10 +8382,10 @@ bool CMainFrame::SeekToDVDChapter(int iChapter, bool bRelative /*= false*/)
DVD_HMSF_TIMECODE currentHMSF = s.fRemainingTime ? RT2HMS_r(stop - HMSF2RT(Location.TimeCode)) : Location.TimeCode;
DVD_HMSF_TIMECODE stopHMSF = RT2HMS_r(stop);
strOSD.Format(_T("%s%s/%s %s, %s%02u/%02lu"),
- s.fRemainingTime ? _T("- ") : _T(""), DVDtimeToString(currentHMSF, stopHMSF.bHours > 0), DVDtimeToString(stopHMSF),
- strTitle, ResStr(IDS_AG_CHAPTER2), Location.ChapterNum, ulNumOfChapters);
+ s.fRemainingTime ? _T("- ") : _T(""), DVDtimeToString(currentHMSF, stopHMSF.bHours > 0).GetString(), DVDtimeToString(stopHMSF).GetString(),
+ strTitle.GetString(), ResStr(IDS_AG_CHAPTER2).GetString(), Location.ChapterNum, ulNumOfChapters);
} else {
- strOSD.Format(_T("%s, %s%02u/%02lu"), strTitle, ResStr(IDS_AG_CHAPTER2), Location.ChapterNum, ulNumOfChapters);
+ strOSD.Format(_T("%s, %s%02u/%02lu"), strTitle.GetString(), ResStr(IDS_AG_CHAPTER2).GetString(), Location.ChapterNum, ulNumOfChapters);
}
m_OSD.DisplayMessage(OSD_TOPLEFT, strOSD, 3000);
@@ -8844,7 +8844,7 @@ void CMainFrame::AddFavorite(bool fDisplayMessage, bool fShowDialog)
DVD_PLAYBACK_LOCATION2 Location;
CString desc;
if (SUCCEEDED(m_pDVDI->GetCurrentLocation(&Location))) {
- desc.Format(_T("%s - T%02u C%02u - %02u:%02u:%02u"), fn, Location.TitleNum, Location.ChapterNum,
+ desc.Format(_T("%s - T%02u C%02u - %02u:%02u:%02u"), fn.GetString(), Location.TitleNum, Location.ChapterNum,
Location.TimeCode.bHours, Location.TimeCode.bMinutes, Location.TimeCode.bSeconds);
} else {
desc = fn;
@@ -10305,7 +10305,7 @@ void CMainFrame::SetBalance(int balance)
strBalance.Format(IDS_BALANCE_R, balance);
}
- strBalanceOSD.Format(IDS_BALANCE_OSD, strBalance);
+ strBalanceOSD.Format(IDS_BALANCE_OSD, strBalance.GetString());
m_OSD.DisplayMessage(OSD_TOPLEFT, strBalanceOSD);
}
}
@@ -11480,7 +11480,7 @@ void CMainFrame::OpenSetupWindowTitle(bool reset /*= false*/)
if (m_pDVDI && SUCCEEDED(m_pDVDI->GetDVDDirectory(path.GetBufferSetLength(MAX_PATH), MAX_PATH, &len)) && len) {
path.ReleaseBuffer();
if (path.Find(_T("\\VIDEO_TS")) == 2) {
- title.AppendFormat(_T(" - %s"), GetDriveLabel(CPath(path)));
+ title.AppendFormat(_T(" - %s"), GetDriveLabel(CPath(path)).GetString());
}
}
}
@@ -12253,7 +12253,7 @@ void CMainFrame::SendNowPlayingToSkype()
}
if (!author.IsEmpty()) {
- msg.Format(_T("%s - %s"), author, title);
+ msg.Format(_T("%s - %s"), author.GetString(), title.GetString());
} else {
msg = title;
}
@@ -12338,7 +12338,7 @@ void CMainFrame::SetupOpenCDSubMenu()
}
CString str;
- str.Format(_T("%s (%c:)"), label, drive);
+ str.Format(_T("%s (%c:)"), label.GetString(), drive);
VERIFY(subMenu.AppendMenu(MF_STRING | MF_ENABLED, id++, str));
}
@@ -12609,12 +12609,13 @@ void CMainFrame::SetupAudioSubMenu()
if (!format.IsEmpty()) {
str.Format(IDS_MAINFRM_11,
- CString(str),
- format,
+ CString(str).GetString(),
+ format.GetString(),
ATR.dwFrequency,
ATR.bQuantization,
ATR.bNumberOfChannels,
- (ATR.bNumberOfChannels > 1 ? ResStr(IDS_MAINFRM_13) : ResStr(IDS_MAINFRM_12)));
+ ResStr(ATR.bNumberOfChannels > 1 ? IDS_MAINFRM_13 : IDS_MAINFRM_12).GetString()
+ );
}
}
@@ -13323,13 +13324,13 @@ CString CMainFrame::GetStreamOSDString(CString name, LCID lcid, DWORD dwSelGroup
if (name.Find(_T("A:")) == 0) {
n = 2;
}
- strMessage.Format(IDS_AUDIO_STREAM, name.Mid(n).Trim());
+ strMessage.Format(IDS_AUDIO_STREAM, name.Mid(n).Trim().GetString());
} else if (dwSelGroup == 2) {
int n = 0;
if (name.Find(_T("S:")) == 0) {
n = 2;
}
- strMessage.Format(IDS_SUBTITLE_STREAM, name.Mid(n).Trim());
+ strMessage.Format(IDS_SUBTITLE_STREAM, name.Mid(n).Trim().GetString());
}
return strMessage;
}
@@ -13411,12 +13412,12 @@ void CMainFrame::SetupFavoritesSubMenu()
BOOL bRelativeDrive = FALSE;
if (_stscanf_s(sl.GetHead(), _T("%d"), &bRelativeDrive) == 1) {
if (bRelativeDrive) {
- str.Format(_T("[RD]%s"), CString(str));
+ str = _T("[RD]") + str;
}
}
}
if (!str.IsEmpty()) {
- f_str.Format(_T("%s\t%.14s"), CString(f_str), CString(str));
+ f_str.AppendFormat(_T("\t%.14s"), str.GetString());
}
}
@@ -13579,7 +13580,7 @@ HRESULT CMainFrame::InsertTextPassThruFilter(IBaseFilter* pBF, IPin* pPin, IPin*
HRESULT hr;
CComQIPtr<IBaseFilter> pTPTF = DEBUG_NEW CTextPassThruFilter(this);
CStringW name;
- name.Format(L"TextPassThru%p", pTPTF);
+ name.Format(L"TextPassThru%p", static_cast<void*>(pTPTF));
if (FAILED(hr = m_pGB->AddFilter(pTPTF, name))) {
return hr;
}
@@ -14133,14 +14134,14 @@ HRESULT CMainFrame::BuildCapture(IPin* pPin, IBaseFilter* pBF[3], const GUID& ma
if (pBuff) {
hr = m_pGB->AddFilter(pBuff, prefix + L"Buffer");
if (FAILED(hr)) {
- err.Format(IDS_CAPTURE_ERROR_ADD_BUFFER, type);
+ err.Format(IDS_CAPTURE_ERROR_ADD_BUFFER, type.GetString());
MessageBox(err, ResStr(IDS_CAPTURE_ERROR), MB_ICONERROR | MB_OK);
return hr;
}
hr = m_pGB->ConnectFilter(pPin, pBuff);
if (FAILED(hr)) {
- err.Format(IDS_CAPTURE_ERROR_CONNECT_BUFF, type);
+ err.Format(IDS_CAPTURE_ERROR_CONNECT_BUFF, type.GetString());
MessageBox(err, ResStr(IDS_CAPTURE_ERROR), MB_ICONERROR | MB_OK);
return hr;
}
@@ -14151,14 +14152,14 @@ HRESULT CMainFrame::BuildCapture(IPin* pPin, IBaseFilter* pBF[3], const GUID& ma
if (pEnc) {
hr = m_pGB->AddFilter(pEnc, prefix + L"Encoder");
if (FAILED(hr)) {
- err.Format(IDS_CAPTURE_ERROR_ADD_ENCODER, type);
+ err.Format(IDS_CAPTURE_ERROR_ADD_ENCODER, type.GetString());
MessageBox(err, ResStr(IDS_CAPTURE_ERROR), MB_ICONERROR | MB_OK);
return hr;
}
hr = m_pGB->ConnectFilter(pPin, pEnc);
if (FAILED(hr)) {
- err.Format(IDS_CAPTURE_ERROR_CONNECT_ENC, type);
+ err.Format(IDS_CAPTURE_ERROR_CONNECT_ENC, type.GetString());
MessageBox(err, ResStr(IDS_CAPTURE_ERROR), MB_ICONERROR | MB_OK);
return hr;
}
@@ -14169,7 +14170,7 @@ HRESULT CMainFrame::BuildCapture(IPin* pPin, IBaseFilter* pBF[3], const GUID& ma
if (pmt->majortype == majortype) {
hr = pAMSC->SetFormat(pmt);
if (FAILED(hr)) {
- err.Format(IDS_CAPTURE_ERROR_COMPRESSION, type);
+ err.Format(IDS_CAPTURE_ERROR_COMPRESSION, type.GetString());
MessageBox(err, ResStr(IDS_CAPTURE_ERROR), MB_ICONERROR | MB_OK);
return hr;
}
@@ -14182,7 +14183,7 @@ HRESULT CMainFrame::BuildCapture(IPin* pPin, IBaseFilter* pBF[3], const GUID& ma
{
hr = m_pGB->ConnectFilter(pPin, pMux);
if (FAILED(hr)) {
- err.Format(IDS_CAPTURE_ERROR_MULTIPLEXER, type);
+ err.Format(IDS_CAPTURE_ERROR_MULTIPLEXER, type.GetString());
MessageBox(err, ResStr(IDS_CAPTURE_ERROR), MB_ICONERROR | MB_OK);
return hr;
}
@@ -14655,7 +14656,7 @@ void CMainFrame::OpenMedia(CAutoPtr<OpenMediaData> pOMD)
ret = IDOK;
} else {
CString msg;
- msg.Format(IDS_MAINFRM_114, fn);
+ msg.Format(IDS_MAINFRM_114, fn.GetString());
ret = AfxMessageBox(msg, MB_RETRYCANCEL);
}
}
@@ -14997,7 +14998,7 @@ LRESULT CMainFrame::OnCurrentChannelInfoUpdated(WPARAM wParam, LPARAM lParam)
if (infoData.hr == S_OK) {
// EIT information parsed correctly
if (infoData.bShowOSD) {
- sChannelInfo.AppendFormat(_T(" | %s (%s - %s)"), NowNext.eventName, NowNext.strStartTime, NowNext.strEndTime);
+ sChannelInfo.AppendFormat(_T(" | %s (%s - %s)"), NowNext.eventName.GetString(), NowNext.strStartTime.GetString(), NowNext.strEndTime.GetString());
}
m_wndInfoBar.SetLine(StrRes(IDS_INFOBAR_TITLE), NowNext.eventName);
@@ -15559,7 +15560,7 @@ void CMainFrame::SendNowPlayingToApi()
label.Replace(L"|", L"\\|");
CStringW buff;
- buff.Format(L"%s|%s|%s|%s|%s", title, author, description, label, strDur);
+ buff.Format(L"%s|%s|%s|%s|%s", title.GetString(), author.GetString(), description.GetString(), label.GetString(), strDur.GetString());
SendAPICommand(CMD_NOWPLAYING, buff);
SendSubtitleTracksToApi();
@@ -15684,7 +15685,7 @@ void CMainFrame::SendAudioTracksToApi()
strAudios.Append(L"|");
}
name.Replace(L"|", L"\\|");
- strAudios.AppendFormat(L"%s", name);
+ strAudios.AppendFormat(L"%s", name.GetString());
if (pmt) {
DeleteMediaType(pmt);
}
@@ -15721,7 +15722,7 @@ void CMainFrame::SendPlaylistToApi()
strPlaylist.Append(L"|");
}
fn.Replace(L"|", L"\\|");
- strPlaylist.AppendFormat(L"%s", fn);
+ strPlaylist.AppendFormat(L"%s", fn.GetString());
}
}
}
@@ -16668,14 +16669,14 @@ CString CMainFrame::GetCaptureTitle()
if (GetPlaybackMode() == PM_ANALOG_CAPTURE) {
CString devName = GetFriendlyName(m_VidDispName);
if (!devName.IsEmpty()) {
- title.AppendFormat(_T(" | %s"), devName);
+ title.AppendFormat(_T(" | %s"), devName.GetString());
}
} else {
CString& eventName = m_pDVBState->NowNext.eventName;
if (m_pDVBState->bActive) {
- title.AppendFormat(_T(" | %s"), m_pDVBState->sChannelName);
+ title.AppendFormat(_T(" | %s"), m_pDVBState->sChannelName.GetString());
if (!eventName.IsEmpty()) {
- title.AppendFormat(_T(" - %s"), eventName);
+ title.AppendFormat(_T(" - %s"), eventName.GetString());
}
} else {
title += _T(" | DVB");
@@ -16701,7 +16702,7 @@ void CMainFrame::UpdateDXVAStatus()
m_HWAccelType = GetDXVAVersion();
CString DXVAInfo;
- DXVAInfo.Format(_T("%-13s: %s"), m_HWAccelType, DXVADecoderDescription);
+ DXVAInfo.Format(_T("%-13s: %s"), m_HWAccelType.GetString(), DXVADecoderDescription.GetString());
// If LAV Video is in the graph, we query it since it's always more reliable than the hook.
if (CComQIPtr<ILAVVideoStatus> pLAVVideoStatus = FindFilter(GUID_LAVVideo, m_pGB)) {
@@ -16709,13 +16710,13 @@ void CMainFrame::UpdateDXVAStatus()
if (decoderName != L"avcodec") {
m_HWAccelType = CFGFilterLAVVideo::GetUserFriendlyDecoderName(decoderName);
CString LAVDXVAInfo;
- LAVDXVAInfo.Format(_T("LAV Video Decoder (%s)"), m_HWAccelType);
+ LAVDXVAInfo.Format(_T("LAV Video Decoder (%s)"), m_HWAccelType.GetString());
if (!m_bUsingDXVA) { // Don't trust the hook
m_bUsingDXVA = true;
- DXVAInfo.Format(_T("H/W Decoder : %s"), LAVDXVAInfo);
+ DXVAInfo.Format(_T("H/W Decoder : %s"), LAVDXVAInfo.GetString());
} else {
- DXVAInfo.AppendFormat(_T(" [%s]"), LAVDXVAInfo);
+ DXVAInfo.AppendFormat(_T(" [%s]"), LAVDXVAInfo.GetString());
}
}
}
@@ -16970,7 +16971,7 @@ LRESULT CMainFrame::OnGetSubtitles(WPARAM, LPARAM lParam)
int ss2 = (t2 / 1000) % 60;
int ms2 = (t2) % 1000;
- content.AppendFormat(fmt, i - k + 1, hh1, mm1, ss1, ms1, hh2, mm2, ss2, ms2, pRTS->GetStrW(i, false));
+ content.AppendFormat(fmt, i - k + 1, hh1, mm1, ss1, ms1, hh2, mm2, ss2, ms2, pRTS->GetStrW(i, false).GetString());
}
pSubtitlesInfo->fileContents = UTF16To8(content);
diff --git a/src/mpc-hc/MediaFormats.cpp b/src/mpc-hc/MediaFormats.cpp
index 4247828c3..d95e604e2 100644
--- a/src/mpc-hc/MediaFormats.cpp
+++ b/src/mpc-hc/MediaFormats.cpp
@@ -348,7 +348,7 @@ void CMediaFormats::GetFilter(CString& filter, CAtlArray<CString>& mask) const
{
CString strTemp;
- filter.AppendFormat(IsExtHidden() ? _T("%s|") : _T("%s (*.avi;*.mp4;*.mkv;...)|"), ResStr(IDS_AG_MEDIAFILES));
+ filter.AppendFormat(IsExtHidden() ? _T("%s|") : _T("%s (*.avi;*.mp4;*.mkv;...)|"), ResStr(IDS_AG_MEDIAFILES).GetString());
mask.Add(_T(""));
for (size_t i = 0; i < GetCount(); i++) {
@@ -376,7 +376,7 @@ void CMediaFormats::GetAudioFilter(CString& filter, CAtlArray<CString>& mask) co
{
CString strTemp;
- filter.AppendFormat(IsExtHidden() ? _T("%s|") : _T("%s (*.mp3;*.aac;*.wav;...)|"), ResStr(IDS_AG_AUDIOFILES));
+ filter.AppendFormat(IsExtHidden() ? _T("%s|") : _T("%s (*.mp3;*.aac;*.wav;...)|"), ResStr(IDS_AG_AUDIOFILES).GetString());
mask.Add(_T(""));
for (size_t i = 0; i < GetCount(); i++) {
diff --git a/src/mpc-hc/Mpeg2SectionData.cpp b/src/mpc-hc/Mpeg2SectionData.cpp
index ed1b49f82..e54f05d0f 100644
--- a/src/mpc-hc/Mpeg2SectionData.cpp
+++ b/src/mpc-hc/Mpeg2SectionData.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2009-2016 see Authors.txt
+ * (C) 2009-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -720,7 +720,7 @@ HRESULT CMpeg2DataParser::ParseNIT()
WORD logical_channel_number = (WORD)gb.BitRead(10);
if (Channels.Lookup(service_id)) {
Channels[service_id].SetOriginNumber(logical_channel_number);
- BDA_LOG(_T("NIT association : %d -> %s"), logical_channel_number, Channels[service_id].ToString());
+ BDA_LOG(_T("NIT association : %d -> %s"), logical_channel_number, Channels[service_id].ToString().GetString());
}
}
break;
diff --git a/src/mpc-hc/PPageCapture.cpp b/src/mpc-hc/PPageCapture.cpp
index 611adef24..d44bb69cb 100644
--- a/src/mpc-hc/PPageCapture.cpp
+++ b/src/mpc-hc/PPageCapture.cpp
@@ -610,7 +610,7 @@ void CPPageCapture::FindAnalogDevices()
}
CString str;
- str.Format(_T("%ld - %s - %s"), s_countrycodes[j].code, s_countrycodes[j].str, standard);
+ str.Format(_T("%ld - %s - %s"), s_countrycodes[j].code, s_countrycodes[j].str, standard.GetString());
int i = m_cbAnalogCountry.AddString(str);
m_cbAnalogCountry.SetItemDataPtr(i, (void*)&s_countrycodes[j]);
diff --git a/src/mpc-hc/PPageFileInfoDetails.cpp b/src/mpc-hc/PPageFileInfoDetails.cpp
index b70c167b1..ea9241d14 100644
--- a/src/mpc-hc/PPageFileInfoDetails.cpp
+++ b/src/mpc-hc/PPageFileInfoDetails.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2016 see Authors.txt
+ * (C) 2006-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -140,7 +140,7 @@ CPPageFileInfoDetails::CPPageFileInfoDetails(CString path, IFilterGraph* pFG, IS
StrFormatByteSizeW(size, szFileSize, MAX_FILE_SIZE_BUFFER);
CString szByteSize;
szByteSize.Format(_T("%I64d"), size);
- m_size.Format(_T("%s (%s %s)"), szFileSize, FormatNumber(szByteSize), ResStr(IDS_SIZE_UNIT_BYTES));
+ m_size.Format(_T("%s (%s %s)"), szFileSize, FormatNumber(szByteSize).GetString(), ResStr(IDS_SIZE_UNIT_BYTES).GetString());
}
if (!creationDate.IsEmpty()) {
diff --git a/src/mpc-hc/PPageFormats.cpp b/src/mpc-hc/PPageFormats.cpp
index 0db398f1c..6a38d4886 100644
--- a/src/mpc-hc/PPageFormats.cpp
+++ b/src/mpc-hc/PPageFormats.cpp
@@ -152,7 +152,7 @@ void CPPageFormats::LoadSettings()
}
CString label;
- label.Format(_T("%s (%s)"), m_mf[i].GetDescription(), m_mf[i].GetExts());
+ label.Format(_T("%s (%s)"), m_mf[i].GetDescription().GetString(), m_mf[i].GetExts().GetString());
int iItem = m_list.InsertItem(i, label);
m_list.SetItemData(iItem, i);
@@ -562,7 +562,7 @@ void CPPageFormats::OnBnClickedResetExtensionsList()
m_exts = mfc.GetExtsWithPeriod();
CString label;
- label.Format(_T("%s (%s)"), mfc.GetDescription(), mfc.GetExts());
+ label.Format(_T("%s (%s)"), mfc.GetDescription().GetString(), mfc.GetExts().GetString());
m_list.SetItemText(iItem, COL_CATEGORY, label);
UpdateMediaCategoryState(iItem);
@@ -586,7 +586,7 @@ void CPPageFormats::OnBnClickedSetExtensionsList()
m_exts = mfc.GetExtsWithPeriod();
CString label;
- label.Format(_T("%s (%s)"), mfc.GetDescription(), mfc.GetExts());
+ label.Format(_T("%s (%s)"), mfc.GetDescription().GetString(), mfc.GetExts().GetString());
m_list.SetItemText(iItem, COL_CATEGORY, label);
UpdateMediaCategoryState(iItem);
diff --git a/src/mpc-hc/PPageFullscreen.cpp b/src/mpc-hc/PPageFullscreen.cpp
index d38908161..c0dc88b2e 100644
--- a/src/mpc-hc/PPageFullscreen.cpp
+++ b/src/mpc-hc/PPageFullscreen.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2016 see Authors.txt
+ * (C) 2006-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -264,7 +264,7 @@ BOOL CPPageFullscreen::OnInitDialog()
CString str = monitorName;
if (monitorName == currentMonitorName) {
- str.AppendFormat(_T(" - [%s]"), ResStr(IDS_FULLSCREENMONITOR_CURRENT));
+ str.AppendFormat(_T(" - [%s]"), ResStr(IDS_FULLSCREENMONITOR_CURRENT).GetString());
}
DISPLAY_DEVICE displayDevice = { sizeof(displayDevice) };
diff --git a/src/mpc-hc/PPageOutput.cpp b/src/mpc-hc/PPageOutput.cpp
index ec559f69f..7da1fdf67 100644
--- a/src/mpc-hc/PPageOutput.cpp
+++ b/src/mpc-hc/PPageOutput.cpp
@@ -173,14 +173,14 @@ BOOL CPPageOutput::OnInitDialog()
if (SUCCEEDED(pPB->Read(_T("FilterData"), &var, nullptr))) {
BSTR* pbstr;
if (SUCCEEDED(SafeArrayAccessData(var.parray, (void**)&pbstr))) {
- fstr.Format(_T("%s (%08x)"), CString(fstr), *((DWORD*)pbstr + 1));
+ fstr.AppendFormat(_T(" (%08x)"), *((DWORD*)pbstr + 1));
SafeArrayUnaccessData(var.parray);
}
}
- Cbstr.Format(_T("%d: %s"), i, fstr);
+ Cbstr.Format(_T("%d: %s"), i, fstr.GetString());
}
} else {
- Cbstr.Format(_T("%d: %s"), i, CString(str));
+ Cbstr.Format(_T("%d: %s"), i, str.GetString());
}
m_iAudioRendererTypeCtrl.AddString(Cbstr);
@@ -191,21 +191,21 @@ BOOL CPPageOutput::OnInitDialog()
}
EndEnumSysDev;
- Cbstr.Format(_T("%d: %s"), i++, ResStr(IDS_PPAGE_OUTPUT_AUD_NULL_COMP));
+ Cbstr.Format(_T("%d: %s"), i++, ResStr(IDS_PPAGE_OUTPUT_AUD_NULL_COMP).GetString());
m_AudioRendererDisplayNames.Add(AUDRNDT_NULL_COMP);
m_iAudioRendererTypeCtrl.AddString(Cbstr);
if (s.strAudioRendererDisplayName == AUDRNDT_NULL_COMP && m_iAudioRendererType == 0) {
m_iAudioRendererType = m_iAudioRendererTypeCtrl.GetCount() - 1;
}
- Cbstr.Format(_T("%d: %s"), i++, ResStr(IDS_PPAGE_OUTPUT_AUD_NULL_UNCOMP));
+ Cbstr.Format(_T("%d: %s"), i++, ResStr(IDS_PPAGE_OUTPUT_AUD_NULL_UNCOMP).GetString());
m_AudioRendererDisplayNames.Add(AUDRNDT_NULL_UNCOMP);
m_iAudioRendererTypeCtrl.AddString(Cbstr);
if (s.strAudioRendererDisplayName == AUDRNDT_NULL_UNCOMP && m_iAudioRendererType == 0) {
m_iAudioRendererType = m_iAudioRendererTypeCtrl.GetCount() - 1;
}
- Cbstr.Format(_T("%d: %s"), i++, ResStr(IDS_PPAGE_OUTPUT_AUD_INTERNAL_REND));
+ Cbstr.Format(_T("%d: %s"), i++, ResStr(IDS_PPAGE_OUTPUT_AUD_INTERNAL_REND).GetString());
m_AudioRendererDisplayNames.Add(AUDRNDT_INTERNAL);
m_iAudioRendererTypeCtrl.AddString(Cbstr);
if (s.strAudioRendererDisplayName == AUDRNDT_INTERNAL && m_iAudioRendererType == 0) {
@@ -304,7 +304,7 @@ BOOL CPPageOutput::OnInitDialog()
CString sName(StrRes(resName));
if (!s.IsVideoRendererAvailable(nID)) {
- sName.AppendFormat(_T(" %s"), ResStr(IDS_PPAGE_OUTPUT_UNAVAILABLE));
+ sName.AppendFormat(_T(" %s"), ResStr(IDS_PPAGE_OUTPUT_UNAVAILABLE).GetString());
}
m_iDSVideoRendererTypeCtrl.SetItemData(m_iDSVideoRendererTypeCtrl.AddString(sName), nID);
@@ -750,7 +750,7 @@ void CPPageOutput::UpdateSubtitleRendererList()
}
if (!CAppSettings::IsSubtitleRendererRegistered(nID)) {
- sName.AppendFormat(_T(" %s"), ResStr(IDS_PPAGE_OUTPUT_UNAVAILABLE));
+ sName.AppendFormat(_T(" %s"), ResStr(IDS_PPAGE_OUTPUT_UNAVAILABLE).GetString());
}
m_SubtitleRendererCtrl.SetItemData(m_SubtitleRendererCtrl.AddString(sName), static_cast<int>(nID));
diff --git a/src/mpc-hc/PPageSubtitles.cpp b/src/mpc-hc/PPageSubtitles.cpp
index 3c47a53c5..cfcebb82c 100644
--- a/src/mpc-hc/PPageSubtitles.cpp
+++ b/src/mpc-hc/PPageSubtitles.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2016 see Authors.txt
+ * (C) 2006-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -284,8 +284,8 @@ BOOL CPPageSubtitles::OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESULT* pResult)
};
::SendMessage(pNMHDR->hwndFrom, TTM_SETMAXTIPWIDTH, 0, 320);
m_strToolTip.Format(IDS_SUBTITLE_DELAY_STEP_TOOLTIP,
- substituteEmpty(CPPageAccelTbl::MakeAccelShortcutLabel(ID_SUB_DELAY_DOWN)),
- substituteEmpty(CPPageAccelTbl::MakeAccelShortcutLabel(ID_SUB_DELAY_UP)));
+ substituteEmpty(CPPageAccelTbl::MakeAccelShortcutLabel(ID_SUB_DELAY_DOWN)).GetString(),
+ substituteEmpty(CPPageAccelTbl::MakeAccelShortcutLabel(ID_SUB_DELAY_UP)).GetString());
pTTT->lpszText = (LPTSTR)(LPCTSTR)m_strToolTip;
bRet = true;
break;
diff --git a/src/mpc-hc/PlayerPlaylistBar.cpp b/src/mpc-hc/PlayerPlaylistBar.cpp
index 49771ed08..61accd7dc 100644
--- a/src/mpc-hc/PlayerPlaylistBar.cpp
+++ b/src/mpc-hc/PlayerPlaylistBar.cpp
@@ -1140,7 +1140,7 @@ void CPlayerPlaylistBar::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruc
CString fmt, file;
fmt.Format(_T("%%0%dd. %%s"), (int)log10(0.1 + m_pl.GetCount()) + 1);
- file.Format(fmt, nItem + 1, m_list.GetItemText(nItem, COL_NAME));
+ file.Format(fmt, nItem + 1, m_list.GetItemText(nItem, COL_NAME).GetString());
CSize filesize = pDC->GetTextExtent(file);
while (3 + filesize.cx + 6 > timept.x && file.GetLength() > 3) {
file = file.Left(file.GetLength() - 4) + _T("...");
@@ -1728,13 +1728,13 @@ void CPlayerPlaylistBar::OnContextMenu(CWnd* /*pWnd*/, CPoint point)
switch (idx) {
case 2:
- str.Format(_T("File%d=%s\n"), i + 1, fn);
+ str.Format(_T("File%d=%s\n"), i + 1, fn.GetString());
break;
case 3:
- str.Format(_T("%s\n"), fn);
+ str.Format(_T("%s\n"), fn.GetString());
break;
case 4:
- str.Format(_T("<Entry><Ref href = \"%s\"/></Entry>\n"), fn);
+ str.Format(_T("<Entry><Ref href = \"%s\"/></Entry>\n"), fn.GetString());
break;
default:
break;
diff --git a/src/mpc-hc/PlayerSeekBar.cpp b/src/mpc-hc/PlayerSeekBar.cpp
index 57c1a5476..412b19a6e 100644
--- a/src/mpc-hc/PlayerSeekBar.cpp
+++ b/src/mpc-hc/PlayerSeekBar.cpp
@@ -351,7 +351,7 @@ void CPlayerSeekBar::UpdateToolTipText()
if (chapterName.Length() == 0) {
m_tooltipText = time;
} else {
- m_tooltipText.Format(_T("%s - %s"), time, chapterName);
+ m_tooltipText.Format(_T("%s - %s"), time.GetString(), static_cast<LPCTSTR>(chapterName));
}
m_ti.lpszText = (LPTSTR)(LPCTSTR)m_tooltipText;
diff --git a/src/mpc-hc/PnSPresetsDlg.cpp b/src/mpc-hc/PnSPresetsDlg.cpp
index 8cbe41d07..b34a5c5f7 100644
--- a/src/mpc-hc/PnSPresetsDlg.cpp
+++ b/src/mpc-hc/PnSPresetsDlg.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2014 see Authors.txt
+ * (C) 2006-2014, 2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -104,7 +104,7 @@ void CPnSPresetsDlg::StringToParams(CString str, CString& label, double& PosX, d
CString CPnSPresetsDlg::ParamsToString(CString label, double PosX, double PosY, double ZoomX, double ZoomY)
{
CString str;
- str.Format(_T("%s,%.3f,%.3f,%.3f,%.3f"), label, PosX, PosY, ZoomX, ZoomY);
+ str.Format(_T("%s,%.3f,%.3f,%.3f,%.3f"), label.GetString(), PosX, PosY, ZoomX, ZoomY);
return str;
}
diff --git a/src/mpc-hc/SaveDlg.cpp b/src/mpc-hc/SaveDlg.cpp
index e3cbfebc2..06aea8ada 100644
--- a/src/mpc-hc/SaveDlg.cpp
+++ b/src/mpc-hc/SaveDlg.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2014 see Authors.txt
+ * (C) 2006-2014, 2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -74,7 +74,7 @@ BOOL CSaveDlg::OnInitDialog()
if (out.GetLength() > 60) {
out = out.Left(17) + _T("..") + out.Right(43);
}
- str.Format(_T("%s\r\n%s"), in, out);
+ str.Format(_T("%s\r\n%s"), in.GetString(), out.GetString());
m_fromto.SetWindowText(str);
m_progress.SetRange(0, 100);
@@ -263,8 +263,8 @@ void CSaveDlg::OnTimer(UINT_PTR nIDEvent)
unsigned int unitSpeed = AdaptUnit(dSpeed, _countof(speedUnits));
str.Format(_T("%.2lf %s / %.2lf %s, %.2lf %s, %I64d s"),
- dPos, ResStr(sizeUnits[unitPos]), dDur, ResStr(sizeUnits[unitDur]),
- dSpeed, ResStr(speedUnits[unitSpeed]), speed > 0 ? (dur - pos) / speed : 0);
+ dPos, ResStr(sizeUnits[unitPos]).GetString(), dDur, ResStr(sizeUnits[unitDur]).GetString(),
+ dSpeed, ResStr(speedUnits[unitSpeed]).GetString(), speed > 0 ? (dur - pos) / speed : 0);
m_report.SetWindowText(str);
m_progress.SetPos(dur > 0 ? (int)(100 * pos / dur) : 0);
diff --git a/src/mpc-hc/SkypeMoodMsgHandler.cpp b/src/mpc-hc/SkypeMoodMsgHandler.cpp
index 47bd642c2..8a41c495b 100644
--- a/src/mpc-hc/SkypeMoodMsgHandler.cpp
+++ b/src/mpc-hc/SkypeMoodMsgHandler.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2013, 2015 see Authors.txt
+ * (C) 2013, 2015, 2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -81,7 +81,7 @@ bool SkypeMoodMsgHandler::HandleMessage(HWND hWnd, COPYDATASTRUCT* pCDS)
CString msg = UTF8To16((char*)pCDS->lpData);
- TRACE(_T("SkypeMoodMsgHandler::HandleMessage --> %s\n"), msg);
+ TRACE(_T("SkypeMoodMsgHandler::HandleMessage --> %s\n"), msg.GetString());
}
return bMsgHandled;
@@ -91,7 +91,7 @@ bool SkypeMoodMsgHandler::SendMessage(CString msg)
{
bool bSuccess = false;
- TRACE(_T("SkypeMoodMsgHandler::SendMessage --> Sending \"%s\"\n"), msg);
+ TRACE(_T("SkypeMoodMsgHandler::SendMessage --> Sending \"%s\"\n"), msg.GetString());
if (!m_hWndSkype) {
TRACE(_T("SkypeMoodMsgHandler::SendMessage --> not connected\n"));
diff --git a/src/mpc-hc/SubtitleDlDlg.cpp b/src/mpc-hc/SubtitleDlDlg.cpp
index b3e55853a..587c28a57 100644
--- a/src/mpc-hc/SubtitleDlDlg.cpp
+++ b/src/mpc-hc/SubtitleDlDlg.cpp
@@ -584,7 +584,7 @@ afx_msg LRESULT CSubtitleDlDlg::OnDownloading(WPARAM /*wParam*/, LPARAM lParam)
SubtitlesInfo& _fileInfo = *(SubtitlesInfo*)lParam;
CString statusMessage;
- statusMessage.Format(IDS_SUBDL_DLG_DOWNLOADING, CString(_fileInfo.Provider()->Name().c_str()), CString(_fileInfo.fileName.c_str()));
+ statusMessage.Format(IDS_SUBDL_DLG_DOWNLOADING, CString(_fileInfo.Provider()->Name().c_str()).GetString(), CString(_fileInfo.fileName.c_str()).GetString());
SetStatusText(statusMessage);
return S_OK;
@@ -595,7 +595,7 @@ afx_msg LRESULT CSubtitleDlDlg::OnDownloaded(WPARAM /*wParam*/, LPARAM lParam)
SubtitlesInfo& _fileInfo = *(SubtitlesInfo*)lParam;
CString statusMessage;
- statusMessage.Format(IDS_SUBDL_DLG_DOWNLOADED, CString(_fileInfo.Provider()->Name().c_str()), CString(_fileInfo.fileName.c_str()));
+ statusMessage.Format(IDS_SUBDL_DLG_DOWNLOADED, CString(_fileInfo.Provider()->Name().c_str()).GetString(), CString(_fileInfo.fileName.c_str()).GetString());
SetStatusText(statusMessage);
for (int i = 0; i < m_list.GetItemCount(); ++i) {
diff --git a/src/mpc-hc/SubtitlesProvider.h b/src/mpc-hc/SubtitlesProvider.h
index 020ef1ccb..d84344b2e 100644
--- a/src/mpc-hc/SubtitlesProvider.h
+++ b/src/mpc-hc/SubtitlesProvider.h
@@ -67,7 +67,7 @@ SRESULT Upload(const SubtitlesInfo& pSubtitlesInfo) override;
std::string UserAgent() const override
{
return SubtitlesProvidersUtils::StringFormat("SubDB/1.0 (MPC-HC/%s; https://mpc-hc.org/)",
- VersionInfo::GetVersionString());
+ VersionInfo::GetVersionString().GetString());
}
DEFINE_SUBTITLESPROVIDER_END
diff --git a/src/mpc-hc/SubtitlesProviders.cpp b/src/mpc-hc/SubtitlesProviders.cpp
index 387c57325..94d619e27 100644
--- a/src/mpc-hc/SubtitlesProviders.cpp
+++ b/src/mpc-hc/SubtitlesProviders.cpp
@@ -596,7 +596,7 @@ void SubtitlesProviders::Upload(bool bShowConfirm)
if (!pSubtitlesInfo.fileContents.empty()) {
CString msg;
- msg.Format(IDS_SUBUL_DLG_CONFIRM, UTF8To16(pSubtitlesInfo.fileName.c_str()));
+ msg.Format(IDS_SUBUL_DLG_CONFIRM, UTF8To16(pSubtitlesInfo.fileName.c_str()).GetString());
if (!bShowConfirm
|| IDYES == MessageBox(m_pMainFrame->m_wndSubtitlesUploadDialog, msg, ResStr(IDS_SUBUL_DLG_TITLE), MB_YESNO)) {
InsertTask(DEBUG_NEW SubtitlesTask(m_pMainFrame, pSubtitlesInfo));
diff --git a/src/mpc-hc/TunerScanDlg.cpp b/src/mpc-hc/TunerScanDlg.cpp
index 9fdf90eb9..c708640b3 100644
--- a/src/mpc-hc/TunerScanDlg.cpp
+++ b/src/mpc-hc/TunerScanDlg.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2009-2016 see Authors.txt
+ * (C) 2009-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -147,7 +147,7 @@ void CTunerScanDlg::OnBnClickedSave()
}
} catch (CException* e) {
// The tokenisation can fail if the input string was invalid
- TRACE(_T("Failed to parse a DVB channel from string \"%s\""), m_ChannelList.GetItemText(i, TSCC_CHANNEL));
+ TRACE(_T("Failed to parse a DVB channel from string \"%s\""), m_ChannelList.GetItemText(i, TSCC_CHANNEL).GetString());
ASSERT(FALSE);
e->Delete();
}
diff --git a/src/mpc-hc/UpdateChecker.cpp b/src/mpc-hc/UpdateChecker.cpp
index e4a015b8d..b1a13e678 100644
--- a/src/mpc-hc/UpdateChecker.cpp
+++ b/src/mpc-hc/UpdateChecker.cpp
@@ -88,7 +88,7 @@ Update_Status UpdateChecker::IsUpdateAvailable(const Version& currentVersion)
headersFmt += _T("\r\n");
CString headers;
- headers.Format(headersFmt, osVersionStr);
+ headers.Format(headersFmt, osVersionStr.GetString());
CHttpFile* versionFile = (CHttpFile*) internet.OpenURL(versionFileURL,
1,
diff --git a/src/mpc-hc/UpdateCheckerDlg.cpp b/src/mpc-hc/UpdateCheckerDlg.cpp
index b667eb198..bb84b8b24 100644
--- a/src/mpc-hc/UpdateCheckerDlg.cpp
+++ b/src/mpc-hc/UpdateCheckerDlg.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2012-2013 see Authors.txt
+ * (C) 2012-2013, 2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -34,16 +34,16 @@ UpdateCheckerDlg::UpdateCheckerDlg(Update_Status updateStatus, const Version& la
case UPDATER_UPDATE_AVAILABLE:
case UPDATER_UPDATE_AVAILABLE_IGNORED:
m_text.Format(IDS_NEW_UPDATE_AVAILABLE,
- latestVersion.ToString(),
- UpdateChecker::MPC_HC_VERSION.ToString());
+ latestVersion.ToString().GetString(),
+ UpdateChecker::MPC_HC_VERSION.ToString().GetString());
break;
case UPDATER_LATEST_STABLE:
m_text.LoadString(IDS_USING_LATEST_STABLE);
break;
case UPDATER_NEWER_VERSION:
m_text.Format(IDS_USING_NEWER_VERSION,
- UpdateChecker::MPC_HC_VERSION.ToString(),
- latestVersion.ToString());
+ UpdateChecker::MPC_HC_VERSION.ToString().GetString(),
+ latestVersion.ToString().GetString());
break;
case UPDATER_ERROR:
m_text.LoadString(IDS_UPDATE_ERROR);
diff --git a/src/mpc-hc/VMROSD.cpp b/src/mpc-hc/VMROSD.cpp
index 1bd797cd0..5c8c2a994 100644
--- a/src/mpc-hc/VMROSD.cpp
+++ b/src/mpc-hc/VMROSD.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2006-2016 see Authors.txt
+ * (C) 2006-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -311,12 +311,12 @@ void CVMROSD::DrawDebug()
CString msg, tmp;
POSITION pos;
pos = m_debugMessages.GetHeadPosition();
- msg.Format(_T("%s"), m_debugMessages.GetNext(pos));
+ msg.Format(_T("%s"), m_debugMessages.GetNext(pos).GetString());
while (pos) {
tmp = m_debugMessages.GetNext(pos);
if (!tmp.IsEmpty()) {
- msg.AppendFormat(_T("\r\n%s"), tmp);
+ msg.AppendFormat(_T("\r\n%s"), tmp.GetString());
}
}
diff --git a/src/mpc-hc/WebClientSocket.cpp b/src/mpc-hc/WebClientSocket.cpp
index 4871ddb98..decd62cf3 100644
--- a/src/mpc-hc/WebClientSocket.cpp
+++ b/src/mpc-hc/WebClientSocket.cpp
@@ -786,11 +786,11 @@ bool CWebClientSocket::OnStatus(CStringA& hdr, CStringA& body, CStringA& mime)
status.Replace(_T("'"), _T("\\'"));
body.Format("OnStatus(\"%s\", \"%s\", %ld, \"%s\", %ld, \"%s\", %d, %d, \"%s\")", // , \"%s\"
- UTF8(title), UTF8(status),
- std::lround(pos / 10000i64), UTF8(ReftimeToString2(pos)),
- std::lround(dur / 10000i64), UTF8(ReftimeToString2(dur)),
+ UTF8(title).GetString(), UTF8(status).GetString(),
+ std::lround(pos / 10000i64), UTF8(ReftimeToString2(pos)).GetString(),
+ std::lround(dur / 10000i64), UTF8(ReftimeToString2(dur)).GetString(),
m_pMainFrame->IsMuted(), m_pMainFrame->GetVolume(),
- UTF8(file)/*, UTF8(dir)*/);
+ UTF8(file).GetString()/*, UTF8(dir)*/);
return true;
}
diff --git a/src/mpc-hc/WebServer.cpp b/src/mpc-hc/WebServer.cpp
index 1e043984f..193c809a1 100644
--- a/src/mpc-hc/WebServer.cpp
+++ b/src/mpc-hc/WebServer.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2016 see Authors.txt
+ * (C) 2006-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -531,7 +531,7 @@ void CWebServer::OnRequest(CWebClientSocket* pClient, CStringA& hdr, CStringA& b
content.Format(
"Content-Type: %s\r\n"
"Content-Length: %d\r\n",
- mime, body.GetLength());
+ mime.GetString(), body.GetLength());
hdr += content;
}
diff --git a/src/mpc-hc/mplayerc.cpp b/src/mpc-hc/mplayerc.cpp
index 24d5891df..32d1c77ff 100644
--- a/src/mpc-hc/mplayerc.cpp
+++ b/src/mpc-hc/mplayerc.cpp
@@ -392,7 +392,7 @@ CStringA GetContentType(CString fn, CAtlList<CString>* redir)
"User-Agent: MPC-HC\r\n"
"Host: %s\r\n"
"Accept: */*\r\n"
- "\r\n", path, host);
+ "\r\n", path.GetString(), host.GetString());
// MessageBox(nullptr, CString(hdr), _T("Sending..."), MB_OK);
@@ -823,7 +823,7 @@ bool CMPlayerCApp::ExportSettings(CString savePath, CString subKey)
if (subKey.IsEmpty()) {
regKey.Format(_T("Software\\%s\\%s"), m_pszRegistryKey, m_pszProfileName);
} else {
- regKey.Format(_T("Software\\%s\\%s\\%s"), m_pszRegistryKey, m_pszProfileName, subKey);
+ regKey.Format(_T("Software\\%s\\%s\\%s"), m_pszRegistryKey, m_pszProfileName, subKey.GetString());
}
FILE* fStream;
@@ -961,10 +961,10 @@ void CMPlayerCApp::FlushProfile(bool bForce/* = true*/)
try {
file.WriteString(_T("; MPC-HC\n"));
for (auto it1 = m_ProfileMap.begin(); it1 != m_ProfileMap.end(); ++it1) {
- line.Format(_T("[%s]\n"), it1->first);
+ line.Format(_T("[%s]\n"), it1->first.GetString());
file.WriteString(line);
for (auto it2 = it1->second.begin(); it2 != it1->second.end(); ++it2) {
- line.Format(_T("%s=%s\n"), it2->first, it2->second);
+ line.Format(_T("%s=%s\n"), it2->first.GetString(), it2->second.GetString());
file.WriteString(line);
}
}
@@ -2087,18 +2087,18 @@ void CRemoteCtrlClient::Connect(CString addr)
CAutoLock cAutoLock(&m_csLock);
if (m_nStatus == CONNECTING && m_addr == addr) {
- TRACE(_T("CRemoteCtrlClient (Connect): already connecting to %s\n"), addr);
+ TRACE(_T("CRemoteCtrlClient (Connect): already connecting to %s\n"), addr.GetString());
return;
}
if (m_nStatus == CONNECTED && m_addr == addr) {
- TRACE(_T("CRemoteCtrlClient (Connect): already connected to %s\n"), addr);
+ TRACE(_T("CRemoteCtrlClient (Connect): already connected to %s\n"), addr.GetString());
return;
}
m_nStatus = CONNECTING;
- TRACE(_T("CRemoteCtrlClient (Connect): connecting to %s\n"), addr);
+ TRACE(_T("CRemoteCtrlClient (Connect): connecting to %s\n"), addr.GetString());
Close();
@@ -2155,7 +2155,7 @@ void CRemoteCtrlClient::OnReceive(int nErrorCode)
}
str.ReleaseBuffer(ret);
- TRACE(_T("CRemoteCtrlClient (OnReceive): %S\n"), str);
+ TRACE(_T("CRemoteCtrlClient (OnReceive): %S\n"), str.GetString());
OnCommand(str);
@@ -2178,7 +2178,7 @@ void CRemoteCtrlClient::ExecuteCommand(CStringA cmd, int repcnt)
if ((repcnt == 0 && wc.rmrepcnt == 0 || wc.rmrepcnt > 0 && (repcnt % wc.rmrepcnt) == 0)
&& (!wc.rmcmd.CompareNoCase(cmd) || wc.cmd == (WORD)strtol(cmd, nullptr, 10))) {
CAutoLock cAutoLock(&m_csLock);
- TRACE(_T("CRemoteCtrlClient (calling command): %s\n"), wc.GetName());
+ TRACE(_T("CRemoteCtrlClient (calling command): %s\n"), wc.GetName().GetString());
m_pWnd->SendMessage(WM_COMMAND, wc.cmd);
break;
}
@@ -2193,7 +2193,7 @@ CWinLircClient::CWinLircClient()
void CWinLircClient::OnCommand(CStringA str)
{
- TRACE(_T("CWinLircClient (OnCommand): %S\n"), str);
+ TRACE(_T("CWinLircClient (OnCommand): %S\n"), str.GetString());
int i = 0, j = 0, repcnt = 0;
for (CStringA token = str.Tokenize(" ", i);
@@ -2215,7 +2215,7 @@ CUIceClient::CUIceClient()
void CUIceClient::OnCommand(CStringA str)
{
- TRACE(_T("CUIceClient (OnCommand): %S\n"), str);
+ TRACE(_T("CUIceClient (OnCommand): %S\n"), str.GetString());
CStringA cmd;
int i = 0, j = 0;