[...]
>
That being said, even if I remove this call and all references to WMI code
> and CoInitializeEx (including the links to wbemuuid and ws2_32), it still
> crashes if i do not create QNetworkManager before QApplication...
>
[...]
>

Our experience is that only the first call to CoInitializeEx() succeeds and
that subsequent calls with a different threading model fail.

That being said, I _assume_ that *both*, QNetworkManager and QApplication
reach a call to CoInitializeEx() somewhere deep down the code (e.g. in a
loaded plugin or even an Explorer extension), and these two calls differ in
the selected threading model. For your application the two cases are:

QNetworkManager before QApplication: QNetworkManager initializes its
desired threading model, the call to CoInitializeEx() in QApplication
fails, but does not cause any harm.

QApplication before QNetworkManager: QApplication initializes its desired
threading model, the call to CoInitializeEx() in QNetworkManager fails and
causes a crash.

To avoid the call to QNetworkManager before QApplication, you should
probably use the /CLRTHREADATTRIBUTE:{MTA,STA,NONE} linker flag (in VS:
Linker - Advanced - CLR Thread Attribute) with the correct value for your
case.

Cheers, Rainer

-- 
Software Engineer | Trimble Imaging Division
Rotebühlstraße 81 | 70178 Stuttgart | Germany
Office +49 711 22881 0 | Fax +49 711 22881 11
http://www.trimble.com/imaging/ | http://www.inpho.de/

Trimble Germany GmbH, Am Prime Parc 11, 65479 Raunheim
Eingetragen beim Amtsgericht Darmstadt unter HRB 83893,
Geschäftsführer: Rob Reeder, Jürgen Kesper
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to