How to get HANDLE in QT Project?
Unsolved
General and Desktop
-
Hi,
I have two threads: mainThread and one for heavy calculations. I would like to use
CancelSynchronousIo ( winapi )
in main thread, but I need HANDLE from second thread.In second thread I have simple object. And I tried in this simpleObject something like that:
void simpleClass::getHandle() // this is slot in simpleObject, which is in the second thread { emit handleFromSecondThread(GetCurrentThread()); }
But when I check the value from GetCurrentThread(), I see that in mainThread and in secondThread this value is the same... How to get the correct value from second thread?
Of course I did:
thread = new QThread(this); simpleObject = simpleClass; simpleObject->moveToThread(thread); thread->start();
-
@qwe3 said in How to get HANDLE in QT Project?:
void simpleClass::getHandle()
I guess you call getHandle() from first thread - is this right?
If so it will, of course return handle from first thread.