[Qt-interest] Qt, DirectX and MultiThreading

Ross Bencina rossb-lists at audiomulch.com
Sat Apr 17 08:45:57 CEST 2010


Ender EREL wrote:
> Ross Bencina wrote:
>> Failing that, I'm a bit hazy on this, but I thought  you're only
>> supposed to talk to a HWND in the thread in which you created it (check
>> MSDN for details)... so you might need to create your DX hosting HWND in
>> your second thread and parent it to the HWND from the main thread. Could
>> be wrong about that though...
>>
>> Good luck!
>>
>> Ross.
>
> Yeah, the problem seems to be caused by this. I can't create the host
> hwnd in the render thread because, well, Qt docs say it's forbidden.

It is forbidden to get Qt to create a HWND in a foreign thread, but that 
shouldn't stop you using Win32 APIs to create a HWND in a foreign thread 
(using CreateWindowEx) and then setting foreignThreadHwnd's parent to your 
QWidget's HWND.

Like I said, I'm a bit hazy on this, but it should be possible.

Ross.




More information about the Qt-interest-old mailing list