Details
-
Bug
-
Resolution: Unresolved
-
P4: Low
-
None
-
5.3.1
-
None
Description
Hi,
I noticed that somewhere deep in QApplication is a call to CoInitializeEx that makes the thread go into STA (single threaded apartment) mode. This is highly undesirable as subsequent calls to COM objects will likewise be STA which in many cases requires running an event loop.
I'm wondering why we need this call and if we can disable it. My program looks like:
QApplication a(argc, argv);
auto hardware= new Hardware(0);//where CoInitializeEx(NULL, COINIT_SPEED_OVER_MEMORY | COINIT_MULTITHREADED); is called.
Even if this disables functionality (drag 'n drop?), having such a flag would be preferable as i'm struggling to write my program which must use certain libraries as MTA.
I appear to be one of many who has run into this problem a similar discussion can be found here: http://stackoverflow.com/questions/2979113/qcroreapplication-qapplication-with-wmi
Attachments
Issue Links
- relates to
-
QTBUG-38398 Copying to clipboard fails with CO_E_NOTINITIALIZED error when linked with C++/CLR library
- Closed