The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
Eating Belgian food at Brouwer's Cafe in Fremont
Last year, some friends and I went for dinner at Brouwer's Café, a Belgian pub/restaurant in the Fremont neighborhood of Seattle. The menu is pub food, which means that everything comes with frites and a choice of several dipping sauces, none of which is ketchup. One of my friends spent some formative years of her life in the Netherlands, so she was familiar with frites and asked for curry ketchup. Unfortunately, they didn't have it. (But I know a great German deli that does carry curry ketchup...) I tried to stay somewhat healthy with a salad, but the croque monsieur pretty much cancelled out any fat-...
Quotation marks around spaces aren't necessary in the PATH environment variable
The purpose of quotation marks is to allow a character that would normally be interpreted as a delimiter to be included as part of a file name. Most of the time, this delimiter is the space. The function uses a space to separate the program name from its arguments. Most programs separate their command line arguments with a space. But the environment variable doesn't use spaces to separate directories. It uses semicolons. This means that if you want to add a directory with spaces in its name to the path, you don't need quotation marks since spaces mean nothing to the environment variable. The quotation marks d...
When you crash, make sure you crash in the right place
Last time, I recommended that functions should just crash when given invalid pointers. There's a subtlety to this advice, however, and that's making sure you crash in the right place. If your function and your function's caller both reside on the same side of a security boundary, then go ahead and crash inside your function. If the caller is a bad guy who is trying to get your function to crash, then there's nothing the caller has accomplished if your function runs in the same security context as the caller. After all, if the caller wanted to make your program do something bad, it could've just done that bad thi...
Saturday is Museum Day, courtesy of Smithsonian Magazine
September 30, 2006 is the first Museum Day open to the general public. (Apparently, previous Museum Days were limited to subscribers of Smithsonian Magazine.) You will have to print out the Museum Day Admissions Coupon to get in. Some restrictions apply. Read the fine print. Even the Institute for Creation Research (an actual museum!) is getting into the act.
IsBadXxxPtr should really be called CrashProgramRandomly
Masking a bug just creates a different, harder-to-find, bug.
News flash: The heart produces urine
In an attempt to explain why astronaut Heidemarie Stefanyshyn-Piper fainted during a welcome ceremony, ABC News reported The heart of an average person on Earth pumps blood throughout the body. But when an astronaut is in space, Levine explained, the blood remains predominantly in their chest cavity. Because of this, he said, the heart tries to get rid of excess blood through urination.
Isn't DDE all asynchronous anyway?
"Isn't DDE all asynchronous anyway?" asks commenter KaiArnold. It's mostly asynchronous, but not entirely. You can read about how DDE works in MSDN, but since it seems people are reluctant to read the formal documentation, I'll repeat here the points relevant to the discussion. The DDE process begins with a search for a service provider. This is done by broadcasting the message and collecting the responses. Each server that wishes to respond to the request sends back a message. The DDE client then chooses which of the servers it wishes to continue the conversation with (possible more than one). The remainde...
Filming for The Battle in Seattle has begun
A few weeks ago, filming for the movie Battle in Seattle began. In Vancouver. Serves us right.
Waiting until the dialog box is displayed before doing something
Last time, I left you with a few questions. Part of the answer to the first question was given in the comments, so I'll just link to that. The problem is more than just typeahead, though. The dialog box doesn't show itself until all message traffic has gone idle. If you actually ran the code presented in the original message, you'd find that it didn't actually work! When you run this program, the message box says "Not Visible", and in fact when it appears, you can see that the main dialog is not yet visible. It doesn't show up until after you dismiss the message box. Mission: Not accomplished. Along th...