The Old New Thing

Doing quick arithmetic from the command prompt

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

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

When you are doing GUI programming, you well know thatthe message pump is the primary way of receiving and dispatchingmessages.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 threadin user mode.You can explicitly queue an APC to a thread with theQueueUserAPC ...
Comments are closed.0 0
Code

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 managerby caching the last item freed (or maybe the last few)so that a subsequent allocation can just re-use the item ratherthan having to go make a new one.But you need to be careful how you do this or you can end upmaking things worse rather than better.Here's an example ...
Comments are closed.0 0
Code

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 SelectObject 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 ...
Comments are closed.0 0
Code