The Old New Thing

Why are there both TBSTYLE_EX_VERTICAL and CCS_VERT?

There are two ways to make a vertical toolbar. You can use the common style, or you can use the extended style which is specific to the toolbar. Why are there two ways of doing the same thing? Because we messed up. Whoever created the extended style didn't realize that there was already a perfectly good way of specifying a vertical ...

Passing by address versus passing by reference, a puzzle

Commenter Mike Petry asked via the Suggestion Box: Why can you dereference a COM interface pointer and pass it to a function with a Com interface reference. The call. The function called. I found some code written like this during a code review. It is wrong but it seems to work. You already know the answer to this question. You...

Excursions in composition: Adding rewind support to a sequential stream

Here's a problem "inspired by actual events": I have a sequential stream that is the response to a request I sent to a web site. The format of the stream is rather messy; it comes with a variable-length header that describes what type of data is being returned. I want to read that header and then hand the stream to an appropriate handler. ...

Excursions in composition: Sequential stream concatenation

As we've seen a few times already (when building context menus and exploring fiber-based enumeration), composition is an important concept in object-oriented programming. Today, we're going to compose two sequential streams by concatenation. There really isn't much to it. The idea is to take two streams and start by reading from the first...

You don't know what you do until you know what you don't do

Many years ago, I saw a Dilbert cartoon that went roughly like this. Frame 1: Supertitle - "Dogbert's guide to project management." Frame 2: Supertitle - "Not a project." Dilbert answers the phone. "Sure, we do that." Frame 3: Supertitle - "A project." Dilbert answers the phone. "No, we don't do that."† I've seen a lot of software ...

The early stages of Joshua Roman groupie-dom

The first time I saw the Seattle Symphony's new principal cellist Joshua Roman, it was at a subscription performance of Mahler's Seventh Symphony in June 2006, shortly after the then-22-year-old took the principal's seat from the retiring Raymond Davis. We noticed that there was a new face in the orchestra, and wondered afterwards, "Who was ...