src/win32: Add support for COINIT_APARTMENTTHREADED
This commit is contained in:
parent
22b840c2f1
commit
0cccdcf9b2
|
@ -31,7 +31,17 @@ public:
|
||||||
COM() {
|
COM() {
|
||||||
if (HRESULT result = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
|
if (HRESULT result = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
|
||||||
FAILED(result)) {
|
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(); }
|
~COM() noexcept { CoUninitialize(); }
|
||||||
|
|
Loading…
Reference in New Issue