diff --git a/src/win32/Com.hxx b/src/win32/Com.hxx index 0c3c400fb..a2aa062a1 100644 --- a/src/win32/Com.hxx +++ b/src/win32/Com.hxx @@ -31,7 +31,17 @@ public: COM() { if (HRESULT result = CoInitializeEx(nullptr, COINIT_MULTITHREADED); FAILED(result)) { - throw FormatHResultError(result, "Unable to initialize COM"); + throw FormatHResultError( + result, + "Unable to initialize COM with COINIT_MULTITHREADED"); + } + } + COM(bool) { + if (HRESULT result = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + FAILED(result)) { + throw FormatHResultError( + result, + "Unable to initialize COM with COINIT_APARTMENTTHREADED"); } } ~COM() noexcept { CoUninitialize(); }