The Old New Thing

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

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

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

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

Win32 user interface work is inherently single-threaded

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

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

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

How do I delay the automatic logon process?

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...

Nicolas Bourbaki, perhaps the biggest inside joke in mathematics

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 ...

Why aren't shortcuts as easy as unix links?

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

Not the best way to start out a form letter

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...

No good deed goes unpunished: Free code samples

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 ...

Unlikely excuses: A faulty microchip

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...