Browse Source

Attempt to fix Qt file dialog issue in Windows

merge-requests/765/head
Adam Honse 4 months ago
parent
commit
944c05814a
  1. 2
      AutoStart/AutoStart-Windows.cpp
  2. 2
      wmi/acpiwmi.cpp
  3. 4
      wmi/wmi.cpp

2
AutoStart/AutoStart-Windows.cpp

@ -83,7 +83,7 @@ bool AutoStart::EnableAutoStart(AutoStartInfo autostart_info)
if(result == CO_E_NOTINITIALIZED)
{
weInitialised = true;
CoInitializeEx(NULL, COINIT_MULTITHREADED);
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
result = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_ALL, IID_IShellLinkW, (void**)&shellLink);
}

2
wmi/acpiwmi.cpp

@ -103,7 +103,7 @@ static bool OpenNotebook()
bool AsWMI_Open()
{
HRESULT init = CoInitializeEx(0, COINIT_MULTITHREADED);
HRESULT init = CoInitializeEx(0, COINIT_APARTMENTTHREADED);
if ( init < 0 && init != -2147417850 )
return 0;
coInitialized = 1;

4
wmi/wmi.cpp

@ -56,7 +56,7 @@ HRESULT Wmi::init()
}
// Initialize COM. ------------------------------------------
hres = CoInitializeEx(0, COINIT_MULTITHREADED);
hres = CoInitializeEx(0, COINIT_APARTMENTTHREADED);
if (FAILED(hres))
{
return hres;
@ -149,7 +149,7 @@ HRESULT Wmi::query(std::string queryStr, std::vector<QueryObj>& queryVectorOut,
IEnumWbemClassObject* pEnumerator = nullptr;
// Initialize COM. ------------------------------------------
hres = CoInitializeEx(0, COINIT_MULTITHREADED);
hres = CoInitializeEx(0, COINIT_APARTMENTTHREADED);
if (FAILED(hres))
{
return hres;

Loading…
Cancel
Save