From 1aca682ad9a55a6e12c794e032463c0bcf5db9d7 Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Mon, 5 Nov 2018 15:24:01 +0100 Subject: [PATCH] Avoid reporting false error for common controls initialization --- windows/init.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/windows/init.cpp b/windows/init.cpp index 6b6752da1..03db29fc6 100644 --- a/windows/init.cpp +++ b/windows/init.cpp @@ -105,8 +105,12 @@ const char *uiInit(uiInitOptions *o) ZeroMemory(&icc, sizeof (INITCOMMONCONTROLSEX)); icc.dwSize = sizeof (INITCOMMONCONTROLSEX); icc.dwICC = wantedICCClasses; - if (InitCommonControlsEx(&icc) == 0) - return ieLastErr("initializing Common Controls"); + if (InitCommonControlsEx(&icc) == 0) { + DWORD last_err = GetLastError(); + if (last_err != 0) { + return initerr("=" "initializing Common Controls", L"GetLastError() ==", last_err); + } + } hr = CoInitialize(NULL); if (hr != S_OK && hr != S_FALSE)