The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

In order to serve you better: Chase resets your marketing preferences
Jan 11, 2008
Post comments count 0
Post likes count 0

In order to serve you better: Chase resets your marketing preferences

Raymond Chen
Raymond Chen

Whenever a company says "In order to serve you better", you can be pretty sure they're about to do something that will make your life more miserable. This time, I'm going to call out Chase Financial Services, who recently sent out notices to customers who had specified that they did not want to receive marketing materials informing them that they now have greater control over which marketing materials they will receive, and the default is that they will receive everything. Strange, you'd think that if somebody said, "Don't send me marketing materials," then they probably meant "Don't send me marketing materials...

Windows is not an MFC delivery channel
Jan 11, 2008
Post comments count 0
Post likes count 0

Windows is not an MFC delivery channel

Raymond Chen
Raymond Chen

Depending on what version of Windows you're running, there may be a variety of support DLLs for things that aren't formal product components, but which are merely along for the ride. For example, Windows 95 came with MFC30.DLL because the Fax Viewer was written with the help of MFC 3.0. But if you look at Windows 98, MFC30.DLL is gone. What happened? What happened is that Windows 98 didn't have a fax viewer that used MFC 3.0. The fact that some MFC 3.0 DLLs wound up on the machine with Windows 95 was merely a side effect of the implementation and not a part of the product spec...

How does the calculator percent key work?
Jan 10, 2008
Post comments count 0
Post likes count 1

How does the calculator percent key work?

Raymond Chen
Raymond Chen

The same way it does on a cheap calculator.

The impact of hardworking employees on their less diligent colleagues
Jan 9, 2008
Post comments count 0
Post likes count 0

The impact of hardworking employees on their less diligent colleagues

Raymond Chen
Raymond Chen

Slate investigates the question "Do hardworking employees make their slacker colleagues more productive?" Tim Harford cites the study Peers at Work by Alexandre Mas and Enrico Moretti which used a grocery store check-out line as its laboratory, and the results are illuminating. (It may be hard to find, but the key paragraph is in the middle of page 4, the one that begins, "We find that...")

Jag är inte heller en Microsoft-talesman på svenska
Jan 9, 2008
Post comments count 0
Post likes count 0

Jag är inte heller en Microsoft-talesman på svenska

Raymond Chen
Raymond Chen

The Swedes haven't quite figured out that my blog entries do not constitute the official position of Microsoft Corporation. I like how they don't even mention my name anywhere. They just say "Microsoft doesn't this" and "Microsoft doesn't that". If you go back to the article they used as a source, you'll see that I provided a variety of reasons for not going into the Start menu point system, but this author decided to claim that reason 1 was not only the only reason but in fact the official reason. Perhaps I should have used a CGI script which randomized the order of the items each time you refreshed.

Generating initials from a name is trickier than you think
Jan 8, 2008
Post comments count 0
Post likes count 0

Generating initials from a name is trickier than you think

Raymond Chen
Raymond Chen

Even though I'm signed in, the page claims that anonymous comments are not allowed, so I'm reduced to posting my comment here and generating a trackback. Some time ago, Robert McLaws wrote a function that generates initials from a name. Let's set aside completely the issue of non-U.S. names; the function doesn't even handle U.S. names correctly. Given Cal Ripken, Jr., the function comes up with the initials JCR, which is decidedly suboptimal.

Taxes: Files larger than 4GB
Jan 8, 2008
Post comments count 0
Post likes count 0

Taxes: Files larger than 4GB

Raymond Chen
Raymond Chen

Nowadays, a hard drive less than 20 gigabytes is laughably small, but it used to be that the capacity of a hard drive was measured in megabytes, not gigabytes. Today, video files and databases can run to multiple gigabytes in size, and your programs need be prepared for them. This means that you need to use 64-bit file offsets such as those used by the function (or if you're willing to fight with the somewhat roundabout way it deals with the high 32 bits of the offset). It also means that you need to pay attention to the of the structure. For example, if your program rejects files smaller than a minimum siz...

Bait and switch literally applied to fish
Jan 7, 2008
Post comments count 0
Post likes count 0

Bait and switch literally applied to fish

Raymond Chen
Raymond Chen

The Saint Petersburg Times purchased fish from several local restaurants and found that nearly half of the time, the fish they got wasn't what they ordered. A state DNA lab came to the same conclusion.

Clean-up functions can't fail because, well, how do you clean up from a failed clean-up?
Jan 7, 2008
Post comments count 0
Post likes count 1

Clean-up functions can't fail because, well, how do you clean up from a failed clean-up?

Raymond Chen
Raymond Chen

Commenter Matt asks how you're supposed to handle failures in functions like or . Obviously, you can't. If a clean-up function fails, there's not much you can do because, well, how do you clean up from a failed clean-up? These clean-up functions fall into the category of "Must not fail for reasons beyond the program's control." If a program tries to close a file and it gets an error back, what can it do? Practically speaking, nothing. The only way a clean-up function can fail is if the program fundamentally screws up, say by attempting to close something that was never open or otherwise passing an invalid para...