Dear Programmers,
I'm experiencing a problem that is a real pain in the ass. As VB doesn't support threading, our project uses a VC++ dll that starts some thread for heavy load processes. This is how we wait for the thread to finish:
...
While WaitForSingleObject(ThreadID,200) = WAIT_TIMEOUT
DoEvents 'don't block the user interface
Wend
...
The problem is that when the DoEvents method gets called when the user clicked a button to open a modal form, the DoEvents method never returns till the user closes the form again (this is understandable, coz DoEvents tries to execute all pending window messages and the modal form waits for the user to close it).
Is there any other way to wait for the thread to end without blocking the user interface (getting rid of the doevents would cause this)?
Thx in advance,
RaKKeR
I'm experiencing a problem that is a real pain in the ass. As VB doesn't support threading, our project uses a VC++ dll that starts some thread for heavy load processes. This is how we wait for the thread to finish:
...
While WaitForSingleObject(ThreadID,200) = WAIT_TIMEOUT
DoEvents 'don't block the user interface
Wend
...
The problem is that when the DoEvents method gets called when the user clicked a button to open a modal form, the DoEvents method never returns till the user closes the form again (this is understandable, coz DoEvents tries to execute all pending window messages and the modal form waits for the user to close it).
Is there any other way to wait for the thread to end without blocking the user interface (getting rid of the doevents would cause this)?
Thx in advance,
RaKKeR