The Old New Thing

Doing quick arithmetic from the command prompt

The command processor comes with a mini-calculator that can perform simple arithmetic on 32-bit signed integers: Note that we had to quote the shift operator since it would otherwise be misinterpreted as a "redirect stdout and append" operator. For more information, type at the command prompt...

The alertable wait is the non-GUI analog to pumping messages

When you are doing GUI programming, you well know that the message pump is the primary way of receiving and dispatching messages. The non-GUI analog to the message pump is the alertable wait. A user-mode APC is a request for a function to run on a thread in user mode. You can explicitly queue an APC to a thread with the function, or you ...

A cache with a bad policy is another name for a memory leak

A common performance trick is to reduce time spent in the heap manager by caching the last item freed (or maybe the last few) so that a subsequent allocation can just re-use the item rather than having to go make a new one. But you need to be careful how you do this or you can end up making things worse rather than better. Here's an example ...

Tips from an American on on driving in Taiwan

Although I have been a passenger in a car many times, I thank my lucky stars that I have never had to be the person behind the wheel in Taiwan. But if you decide you want to give it a shot, you might want to pick up some driving tips from an American who spent time in Taiwan as an English teacher, part of his Teaching English in Taiwan site...

What's so special about bitmaps and DCs?

You can select pens, brushes, fonts and bitmaps into a DC with the function, and from this list, bitmaps are special. Because, if you look carefully, bitmaps are the only modifiable objects on the list. Pens, brushes and fonts cannot be modified once they are created. But bitmaps, oh, bitmaps. A bitmap selected into a DC changes as you draw ...