From 32bb4696396e48521614d00e5b8f6e6586822f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 3 Aug 2022 20:51:23 +0200 Subject: Minor improvements. --- c/main.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'c/main.cpp') diff --git a/c/main.cpp b/c/main.cpp index 79fb8eb..87b15be 100644 --- a/c/main.cpp +++ b/c/main.cpp @@ -67,16 +67,17 @@ void OnTerminate() noexcept try { why = PlString(t); } catch (...) {} } catch (const Win32Error& e) { what = L"a Windows error"; - try { why = wchar_ptr::copy(e.WhatW()); } catch (...) {} + try { why = wchar_ptr::copy(e.What()); } catch (...) {} } catch (const std::exception& e) { try { why = wchar_ptr::from_narrow(e.what()); } catch (...) {} } catch (...) {} wchar_t msg[256] = {0}; if (why) - wszf(msg, L"Episode Browser was terminated due to %s: %s", what, static_cast(why)); + Swprintf(msg, L"Episode Browser was terminated due to %s: %s", + what, static_cast(why)); else - wszf(msg, L"Episode Browser was terminated due to %s.", what); + Swprintf(msg, L"Episode Browser was terminated due to %s.", what); MessageBox(g_hWnd, msg, L"Fatal Error", MB_ICONERROR); _Exit(1); @@ -485,7 +486,7 @@ void HandleContextMenu(const HWND, unsigned short command) L"Error", MB_ICONWARNING); } else if (cNotFound) { wchar_t msg[64] = {0}; - wszf(msg, L"%d episodes could not be opened locally.", cNotFound); + Swprintf(msg, L"%d episodes could not be opened locally.", cNotFound); EBMessageBox(msg, L"Error", MB_ICONWARNING); } else if (ID_SUBGROUP(command) == IDG_CTX_RATE) { g_elv->Sort(); @@ -503,7 +504,7 @@ void WaitFor(const char* mod, const char* pred) if (bActive) { wchar_t msg[256] = {0}; - wszf(msg, L"Another task (%s) is active. " + Swprintf(msg, L"Another task (%s) is active. " L"Do you want to cancel the existing task and start a new one?", static_cast(activePred)); if (EBMessageBox(msg, L"Error", MB_YESNO|MB_ICONWARNING) != IDYES) -- cgit v1.2.3