Corrections to the answers I gave at the end of my PDC talk

Raymond Chen

I guess one advantage of having a web site is that I can publish errata. I haven’t watched the Channel9 video (and probably never will; it’s hard to watch yourself), but I do remember some of the questions at the end that I wasn’t able to answer off the top of my head, but after a few days’ research I think I can do it now.

The person who asked “When I call MessageBox from my MFC application and shut down the system, why does my application crash?” stopped by the Fundamentals Lounge later that day, and we went into more detail about his problem. It turns out that he was a victim of one of the bullet points I called out in the section on parents and owners: He was passing NULL as the owner window to MessageBox, which created two top-level unowned windows on the same thread, something I also explained earlier this year when discussing the importance of setting the correct owner for modal UI. As a result, the handling of the shutdown message resulted in the support for the message box being torn down while it was still live on the stack. (I didn’t cover this in my talk because I didn’t want to bore people with information they could already have gotten by reading my earlier articles. After all, the talk wasn’t titled “Raymond’s Greatest Hits”.)

I made a mistake in my answer to the question about transferring input due to a mistaken input queue assignment due to a hole in a regional window. In fact, the message does not move between input queues; the window manager does a full hit-test against the region before deciding which input queue gets the message. The point of queue transfer is not to transfer the message, as I mistakenly described, but rather is to transfer the wake flag. If there are two input messages in an input queue, one for thread A and the second for thread B, then it is thread A that is woken first to process the input. When thread A processes the first message and then goes back to ask for the second message, the queue manager sees that the next message in the input queue is for thread B. At this point, it wakes up thread B and tells it that it is being woken due to an input transfer: “It’s your turn now.”

It so happens that as you all came to my talk to check me out, I had spies in the crowd checking you out. Sara Ford, a Microsoft celebrity in her own right, told me that the buzz in the crowd was that I’m so short. Well, in my defense, I would like to point out that being on a raised platform makes me look shorter since the front of the table takes about six inches off my height due to the angle.

But yeah, I’m short.

And I’ll take it as a compliment that you don’t consider me to be old or fat.

For those who were wondering: What was I doing when I was fiddling with the second computer on the table? That computer was running a giant clock program so I could see how I was doing on time. For some strange reason, the standard PDC equipment for a talk doesn’t include a clock! I was fiddling with it because I forgot to disable the screen saver, so I had to wake up the computer periodically in order to keep the clock visible.

Note that I never said that I never wanted to be on video. What I said was that I don’t do interviews.

Assuming the PDC organizers ask me back for the next PDC (big assumption) what do you think the title of my next talk should be?

0 comments

Discussion is closed.

Feedback usabilla icon