semajnosnibor
20th January 2012, 21:11
I'm having an odd issue with a worker thread I've created.
I have the line 'CoInitialize(0);' in the threads run(). The worker thread basically communicates with EXCEL, so it has a bunch of public member functions to accomplish that. However any of the activeQT calls within those public member functions only operate correctly when called from within the worker thread (specifically in the run() function).
When the worker thread is in the event loop, none of the ActiveQT calls work (they act as if CoInitialize() has not been called).
Basically my steps are:
1) create the worker thread
2) call the 'start()' on the worker thread (which calls run())
3) run initializes the QAxObject
4) once the QAxObjet is created, run calls exec();
After exec() was called, I was under the impression I could use the workerThreadObject like any other object...
I have the line 'CoInitialize(0);' in the threads run(). The worker thread basically communicates with EXCEL, so it has a bunch of public member functions to accomplish that. However any of the activeQT calls within those public member functions only operate correctly when called from within the worker thread (specifically in the run() function).
When the worker thread is in the event loop, none of the ActiveQT calls work (they act as if CoInitialize() has not been called).
Basically my steps are:
1) create the worker thread
2) call the 'start()' on the worker thread (which calls run())
3) run initializes the QAxObject
4) once the QAxObjet is created, run calls exec();
After exec() was called, I was under the impression I could use the workerThreadObject like any other object...