Posts by this author

Mar 29, 2007
Post comments count0
Post likes count1

The buffer size parameter to GetFileVersionInfo is the size of your buffer, no really

The function takes a pointer to a buffer () and a size (), and that size is the size of the buffer, in bytes. No really, that's what it is. The application compatibility folks found one popular game which wasn't quite sure what that parameter meant. The programmers must have thought it meant "The size of the version resources you want to loa...

Code
Mar 28, 2007
Post comments count0
Post likes count1

The social skills of a thermonuclear device, part 4

Last summer, one of my colleagues thought it would be fun to have an informal "lunch chat with Raymond" as a special treat for our summer interns. One of the interns reacted to the invitation a bit unexpectedly, asking meekly, "Is he going to yell at us?"

OtherThe social skills of a thermonuclear device
Mar 28, 2007
Post comments count0
Post likes count0

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 toolbar (na...

Other
Mar 26, 2007
Post comments count0
Post likes count0

The publicity machine continues: A chat with Scott Hanselman and Hanselminutes

Scott Hanselman let me know he was going to be in town, and after some negotiation with the company PR department (who probably get the massive heebie-jeebies from this whole blog thing), I was able to accept his invitation to appear on his weekly podcast, HanselMinutes. We sat down for a little chat, and a few weeks later, I became Show #56. ...

Non-Computer
Mar 26, 2007
Post comments count0
Post likes count0

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 mere...

Code
Mar 23, 2007
Post comments count0
Post likes count0

The wisdom of seventh graders and you: Design a course

I'm out today to volunteer with grading student essays. The topic the students were given is one that I suggested: "You have been chosen to design a new elective for your school. Describe what it would be." In a few weeks, you'll learn what the students wrote, but my question for you is what you would propose in your essay. You can answer the ques...

Non-ComputerThe wisdom of seventh graders
Mar 23, 2007
Post comments count0
Post likes count0

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. But t...

Code
Mar 22, 2007
Post comments count0
Post likes count0

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 one....

Code
Mar 21, 2007
Post comments count0
Post likes count1

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 projects, ...

Other