Showing results for October 2007 - Page 2 of 4 - The Old New Thing

Oct 22, 2007
0
0

The best way to process Unicode input is to make somebody else do it

Raymond Chen
Raymond Chen

Andrew M asks via the Suggestion Box: I was hoping you could address how to properly code Unicode character input. It seems like a lot of applications don't support it correctly. I'm not sure I understand the question, but the answer is pretty easy: Don't do it! Text input is hard. It should be left to the professionals. This means you should...

Code
Oct 19, 2007
0
0

Other problems traced to violating COM single-threaded apartment rules in the shell

Raymond Chen
Raymond Chen

Probably the biggest category of problems that can be traced to violating COM single-threaded apartment rules in the shell is using an object from the wrong thread. Of course, nobody admits to doing this up front, They just report that the shell is broken. We can't enumerate the items on the desktop any more. We take the pointer returned by and...

Code
Oct 18, 2007
0
0

Win32 user interface work is inherently single-threaded

Raymond Chen
Raymond Chen

At the end of the day, there's a window handle in there. As we saw a few years ago, windows have thread affinity. You can push work to a background thread all you want, but once you send a message to the window (or do something that results in a message being sent to the window), you've given control to the UI thread. Since the shell is all abou...

Code
Oct 17, 2007
0
0

The wrong way to check whether the mouse buttons have been swapped

Raymond Chen
Raymond Chen

Back in the late 1990's, the window manager team received a bug that said that sometimes the mouse button state got messed up and the computer acted as if the buttons were stuck down. Further investigation revealed that it occurred only when one particular program was running, and only if the user had enabled mouse button swapping. The reason is...

Code
Oct 16, 2007
0
0

How do I delay the automatic logon process?

Raymond Chen
Raymond Chen

To solve some problems you need to place one foot outside the box. We have a number of kiosk machines that are networked wirelessly. Each machine is configured with automatic logon so that things return to normal after power is restored after an outage. The problem is that the wireless switch takes a long time to recover from a power failure, so w...

Tips/Support
Oct 15, 2007
0
0

Nicolas Bourbaki, perhaps the biggest inside joke in mathematics

Raymond Chen
Raymond Chen

If you've studied advanced mathematics, you've certainly read or at least heard about the books and papers of the great French mathematician Nicolas Bourbaki, whose works in the 1930's set out a rigorous formulation of modern mathematics. Except he never actually existed. The name was created as a front for a group of renegade French mathematicia...

Non-Computer
Oct 15, 2007
0
0

Why aren't shortcuts as easy as unix links?

Raymond Chen
Raymond Chen

Commenter dingo asks, "Why are shortcuts so hard to manipulate? Why can't they be as easy as unix links?" Well, if you want something like unix links, then you can just create a hard link. Creating them is about the same difficulty ( vs ) and manipulating them is the same since you don't actually manipulate a hard link. You just use it like a regu...

Code
Oct 12, 2007
0
0

Not the best way to start out a form letter

Raymond Chen
Raymond Chen

Special Welcome Back Offer From the President of The Wall Street Journal Online Dear Do Not Edit These Fields, My name is Todd Larsen and I'm the president of THE WALL STREET JOURNAL ONLINE... Pre-emptive snarky comment: I got a lame form letter from Microsoft once.

Non-Computer
Oct 12, 2007
0
0

No good deed goes unpunished: Free code samples

Raymond Chen
Raymond Chen

There's no such thing as a free lunch. Or free code either. Many years ago, I wrote some samples for the SDK as a favor, and at each major SDK release, I am reminded that no good deed goes unpunished. I can tell when a major SDK release is coming, because I get a piece of mail that goes something like this: Hi. You are on file as the owner of at...

OtherNo good deed goes unpunished
Oct 11, 2007
0
0

Unlikely excuses: A faulty microchip

Raymond Chen
Raymond Chen

Last year, a talking action figure was discovered to utter a curse word. A spokesperson for the store said that the problem might be a faulty microchip. Huh? What microchips fail by saying curse words? I mean, I can see the voice chip failing by generating static or chopping up the audio so as to become unintelligible, but what are the odds that...

Non-Computer