Commit 0cccdcf9 authored by Shen-Ta Hsieh's avatar Shen-Ta Hsieh Committed by Max Kellermann

src/win32: Add support for COINIT_APARTMENTTHREADED

parent 22b840c2
......@@ -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(); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment