The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Sep 14, 2009
Post comments count 0
Post likes count 0

A complex family calculus

Raymond Chen

I spent the other night at a relative's house, and I was woken the next morning by my young niece who politely asked me to make her breakfast. (Her technique for waking me up is to come in and call my name. If the door is closed, she pounds on the bedroom door and shouts, "Wake up! Wake up!" If I fail to open the door, she opens it herself. If the door is locked, she jiggles the handle until she forces the door open. I just leave the door open now. Making the best of a bad situation.) Anyway, later that morning, the following conversation took place between my niece and an adult family member (which conversation...

Sep 14, 2009
Post comments count 0
Post likes count 1

Can you create an information context for the display?

Raymond Chen

Adrian McCarthy asks, "Can you create an information context for the display? ... I can call CreateDC("DISPLAY"), but perhaps that wouldn't generalize for a multiple-monitor display with different settings on each screen. I'm trying to avoid constantly creating and destroying DCs when all I need to do is measure strings, check color depth, dpi, etc." I admire the effort of trying to avoid creating a whole DC when all you want is to perform some inquiries. Some inquiries are monitor-independent, like getting the DPI or measuring strings, so you can just use to get a temporary DC. This is cheaper than a full-on ...

Sep 11, 2009
Post comments count 0
Post likes count 0

Most people who go to an open house aren't actually interested in buying it

Raymond Chen

You have a house for sale. You hold an open house. But not everybody who attends is there because they're interested in buying the house. The first wave are neighbors who are curious about the house they've seen for years only from the outside. Then there are the people who just enjoy looking at other people's houses. And occasionally, people drop by looking for chicken wings.

Sep 11, 2009
Post comments count 0
Post likes count 1

If you're handling an out of memory exception, you probably shouldn't allocate memory

Raymond Chen

With the assistance of Application Verifier, specifically, low resource simulation (also known as fault injection), a tester found a stack overflow condition. As we learned earlier, the important thing to look at when studying a stack overflow is the repeating section. When this stack trace was shown to the development team, they instantly recognized the cause of the problem. And you also have enough information to figure it out, too. Hint: Of the most likely reasons that a method named would throw an error, which of them match the scenario? Since we are simulating low resources, the error being thrown...

Sep 10, 2009
Post comments count 0
Post likes count 0

Start with a $50,000 grant, hold a fundraiser, lose $47,000

Raymond Chen

Phase three: Not profit. Coolidge High School received a $50,000 grant from AOL Time Warner to help keep the school computer systems running. Add a bizarre and disastrous fundraiser run by a confessed fraudster, and the next thing you know, nearly all of the money vanished before the year was out.

Sep 10, 2009
Post comments count 0
Post likes count 1

Management-speak: Focus

Raymond Chen

Management likes to use the word focus. They like it so much, that anything important is called a focus. That's an interesting scenario, one which we hope to address, but it's not our main focus. We're focusing on three features for this release. But how can you focus on more than one thing? The first citation implies that there's more than one focus (a main focus, and maybe some secondary foci); the second citation makes explicit the mutiplicity of foci. But a lens doesn't focus on more than one thing. There is one focus, the point at which parallel rays from infinity converge. Then again, if a lens is de...

Sep 9, 2009
Post comments count 0
Post likes count 0

Hey, you look Chinese, we have a class for people like you

Raymond Chen

(The title is a callback to this article from a few months ago.) A member of my extended family grew up near the city of Nanaimo, Canada. While it's true that she's ethnically Chinese, it's also true that she's a fourth generation Canadian. The community is overwhelmingly English-speaking, and English is her first language. She grew up going to an English-language school, she watched English-language television, spoke English with her friends and family, and probably dreamed dreams in English. Yet when the family moved to Vancouver when she was a child (I don't know the exact age, so let's say eight years old...

Sep 9, 2009
Post comments count 0
Post likes count 1

When you agree to write to a particular length, make sure your content is actually that length

Raymond Chen

Your editor has a magazine to fill.

Sep 8, 2009
Post comments count 0
Post likes count 0

Why are developer tools orange?

Raymond Chen

The Secret Geek Leon Bambrick wonders why developer tools are orange. Coincidence? Worldwide conspiracy?