The Old New Thing

Don't be helpless: What might be the reason for a "Path not found" error?

Internally at Microsoft, we have a programmer's tool which I will call Program Q. On the peer-to-peer mailing list for Program Q, somebody asked the following question: When I try to do a , instead of opening an editor window where I can modify the template, I get the following error: Can you help resolve this error? Okay...

Microspeak: Turds

In Microspeak, a turd is a graphics glitch which results in old pixels appearing on the screen when they shouldn't. Perhaps they are not being erased properly, or instead of being erased, they move to an unwanted location. The source of the problem could be failing to mark a region for redrawing after something changed, or it could be that the...

Why does PrintWindow hate CS_PARENTDC? Because EVERYBODY hates CS_PARENTDC!

Commenter kero wants to know why the function hates . (And , and .) Because everybody hates ! (And , and .) We saw earlier that these class styles violate widely-held assumptions about how drawing works. I mean, who would have thought that asking for two device contexts would give you the same one back twice? Or that changes to one device...

The time I watched a total lunar eclipse from the top of a mountain

One of my colleagues loves doing outdoorsy things, and he also loves space and astronomy. Many years ago, he invited a small number of us on an outing that combined both of his interests: A hike up a mountain to view the total lunar eclipse. Since an eclipse does not wait until you're ready, it's kind of important to stay on schedule or you'...

How do I prefetch data into my memory-mapped file?

A customer created a memory mapping on a large file and found that when the memory manager wanted to page in data from that file, it did so in 32KB chunks. The customer wanted to know if there was a way to increase the chunk size for efficiency. The memory manager decides the chunk size for memory-mapped files, and the chunk size is currently...