diff --git a/src/win32/Com.hxx b/src/win32/Com.hxx index ded264ee2..0c3c400fb 100644 --- a/src/win32/Com.hxx +++ b/src/win32/Com.hxx @@ -29,8 +29,8 @@ class COM { public: COM() { - HRESULT result = CoInitializeEx(nullptr, COINIT_MULTITHREADED); - if (FAILED(result)) { + if (HRESULT result = CoInitializeEx(nullptr, COINIT_MULTITHREADED); + FAILED(result)) { throw FormatHResultError(result, "Unable to initialize COM"); } }