Thus spake Bill Medland: [...] > 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?
I suspect you are calling MessageBox() during processing of a message sent via SendMessage() during processing of another message posted to the control's queue. That is typically a recipe for confusion or worse; one way to avoid it, though it might not make MessageBox() debugging very useful, is to call MessageBox() only when InSendMessage() returns FALSE.