I have a VB6 COM client that makes calls to an inprocess STA ATL/COM server. One of the Server methods, X, can take a while to finish so I need to be able to cancel it. What I tried was to run the method code in a new thread and include another method, Y, that does a timed WaitForSinleObject. So the client first calls X then goes into a loop calling VB6 DoEvents and then Y until Y indicates that X has finished. This works fine, however, the fly in the ointment is that the X thread also triggers events back to the client via the IConnectionPoint interface. The events get through ok but any GUI calls don't work because, as far as I can glean, the GUI can only work on one thread, ie the main thread.
Is there an obvious way round this using my existing code? Alternatively, please can you suggest other ways I could accomplish this.
Thanks in advance.