thread confusion

Ove Kaaven ovehk at ping.uio.no
Wed Aug 21 14:39:33 CDT 2002


On Tue, 20 Aug 2002, Bill Medland wrote:

> I added a couple of MessageBox calls in the source of the control's code.
> While the OCX was loading the "before" and "after" message boxes were
> displayed as expected.  However once the OCX was up and I pulled down the
> dropdown list the "before" message box popped up TWICE and you had to say OK
> to them in the correct order to get the pair of "after" boxes.  So I
> included GetCurrentThreadID in the message they displayed, thinking that we
> now had two threads.  But both had (or appeared to have) the same thread ID.
> So I turned on the dialog warnings and, yes, the second call to MessageBox
> was occurring while the first was still executing.
> 
> Anyone know what is going on there?

It's not that surprising. Though MessageBox will in your cause block the
processing of the message you called it in, MessageBox runs its own
message loop (complete with DispatchMessage), so *new* messages can still
be received, dispatched, and processed when the messagebox is running,
which means that your handler can easily get recursed into, and under the
right circumstances, you can even get infinite recursion, overload and
crash Windows, and need to reboot...




More information about the wine-devel mailing list