summaryrefslogtreecommitdiff
path: root/src/win32
diff options
context:
space:
mode:
authorShen-Ta Hsieh <ibmibmibm.tw@gmail.com>2020-12-02 07:19:36 +0800
committerMax Kellermann <max@musicpd.org>2021-03-04 18:37:56 +0100
commit0cccdcf9b215a41f4f600207f326e93b3c11fdfe (patch)
treed7fcb84d76670e8709d3676b3190c6d8d5191798 /src/win32
parent22b840c2f18a225aa706b9d3fcce2f7b0f319975 (diff)
src/win32: Add support for COINIT_APARTMENTTHREADED
Diffstat (limited to 'src/win32')
-rw-r--r--src/win32/Com.hxx12
1 files changed, 11 insertions, 1 deletions
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(); }