aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--c/main.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/c/main.cpp b/c/main.cpp
index 236b6d3..4fc2fd5 100644
--- a/c/main.cpp
+++ b/c/main.cpp
@@ -64,10 +64,12 @@ int WINAPI WinMain(
icc.dwSize = sizeof(icc);
icc.dwICC = ICC_WIN95_CLASSES;
if (!InitCommonControlsEx(&icc))
- throw Err(WINDOWS, L"Common controls could not be initialized: %s");
+ return EBMessageBox(Err(WINDOWS, L"Common controls could not be initialized: %s").what,
+ L"Initialization Error", MB_ICONERROR), 1;
if (CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED) != S_OK)
- throw Err(GENERIC, L"COM library could not be initialized");
+ return EBMessageBox(L"COM library could not be initialized",
+ L"Initialization Error", MB_ICONERROR), 1;
WNDCLASSEX wc;
memset(&wc, 0, sizeof(WNDCLASSEX));
@@ -81,7 +83,8 @@ int WINAPI WinMain(
wc.lpszClassName = L"Episode Browser";
wc.hIconSm = LoadIconW(nullptr, IDI_APPLICATION);
if (!RegisterClassExW(&wc))
- throw Err(WINDOWS, L"Window class could not be registered: %s");
+ return EBMessageBox(Err(WINDOWS, L"Window class could not be registered: %s").what,
+ L"Initialization Error", MB_ICONERROR), 1;
/* InitializeMainWindow is called before the first message is
* sent to WndProc. This is important, as it initializes
@@ -95,7 +98,8 @@ int WINAPI WinMain(
WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN,
XMAIN, YMAIN, 0, 0,
nullptr, nullptr, hInstance, nullptr)))
- throw Err(WINDOWS, L"Main window could not be created: %s");
+ return EBMessageBox(Err(WINDOWS, L"Main window could not be created: %s").what,
+ L"Initialization Error", MB_ICONERROR), 1;
if (!(g_window->hWndStatus = CreateWindowExW(
0,
@@ -104,7 +108,8 @@ int WINAPI WinMain(
WS_CHILD|WS_VISIBLE|SBARS_SIZEGRIP,
0, 0, 0, 0,
hWnd, reinterpret_cast<HMENU>(IDR_STATUS), hInstance, nullptr)))
- throw Err(WINDOWS, L"Status bar could not be created: %s");
+ return EBMessageBox(Err(WINDOWS, L"Status bar could not be created: %s").what,
+ L"Initialization Error", MB_ICONERROR), 1;
ShowWindow(hWnd, nCmdShow);