diff options
Diffstat (limited to 'compat/win32-com.cpp')
-rw-r--r-- | compat/win32-com.cpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/compat/win32-com.cpp b/compat/win32-com.cpp deleted file mode 100644 index b782e3a7..00000000 --- a/compat/win32-com.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#ifdef _WIN32 - -#include "win32-com.hpp" - -#include "compat/util.hpp" - -#include <QString> -#include <QCoreApplication> -#include <QApplication> -#include <QThread> -#include <QDebug> - -bool OPENTRACK_COMPAT_EXPORT init_com_threading(com_type t_) -{ - const com_type t = progn( - if (t_ != com_invalid) - return t_; - if (QCoreApplication::instance() == nullptr) - return com_apartment; - if (qApp->thread() == QThread::currentThread()) - return com_apartment; - else - //return com_multithreaded; - return com_apartment; - ); - - HRESULT ret = CoInitializeEx(0, t); - - if (ret != S_OK && ret != S_FALSE) - { - qDebug() << "CoInitializeEx failed" << (progn ( - switch (ret) - { - case RPC_E_CHANGED_MODE: - return QStringLiteral("COM threading mode already set"); - default: - return QStringLiteral("Unknown error ") + QString::number(long(ret)); - } - )); - return false; - } - - return true; -} -#endif |