From eda47922d9bd6d10e4e2fb3d3191edfaa126aef5 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 12 Aug 2016 17:03:51 +0200 Subject: few: use existing com threading init function --- opentrack-dinput/dinput.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'opentrack-dinput') diff --git a/opentrack-dinput/dinput.cpp b/opentrack-dinput/dinput.cpp index 06b5e4f2..217df6a7 100644 --- a/opentrack-dinput/dinput.cpp +++ b/opentrack-dinput/dinput.cpp @@ -1,6 +1,7 @@ #ifdef _WIN32 #include "dinput.hpp" +#include "opentrack-compat/win32-com.hpp" #include std::atomic dinput_handle::refcnt; @@ -9,9 +10,7 @@ dinput_handle::di_t dinput_handle::handle(dinput_handle::make_di()); LPDIRECTINPUT8& dinput_handle::init_di() { - HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); - if (FAILED(hr)) - qDebug() << "dinput: failed CoInitializeEx" << hr << GetLastError(); + init_com_threading(com_multithreaded); static LPDIRECTINPUT8 di_ = nullptr; if (di_ == nullptr) -- cgit v1.2.3