From 62c137157ed04d08e6bcc7a741bcdb046943776f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 17 Aug 2016 21:40:22 +0200 Subject: compat/win32-com: default to right COM type without caller specifying it The main window always needs the apartment threaded context for OLE used by Qt. Default to apartment threaded before a QApplication is created, or if the thread is the QApplication thread. Use multithreaded COM otherwise. --- compat/win32-com.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compat/win32-com.hpp') diff --git a/compat/win32-com.hpp b/compat/win32-com.hpp index 4e535815..fe2b478f 100644 --- a/compat/win32-com.hpp +++ b/compat/win32-com.hpp @@ -11,8 +11,9 @@ enum com_type : int { com_multithreaded = COINIT_MULTITHREADED, com_apartment = COINIT_APARTMENTTHREADED, + com_invalid = 0, }; -bool OPENTRACK_COMPAT_EXPORT init_com_threading(com_type t); +bool OPENTRACK_COMPAT_EXPORT init_com_threading(com_type t = com_invalid); #endif -- cgit v1.2.3