Showing archive results for 2007

Jul 3, 2007
Post comments count0
Post likes count1

If the system says that an embedded string could not be converted from Unicode to ANSI, maybe it's trying to tell you something

Raymond Chen

It's probably trying to tell you that an embedded string could not be converted from Unicode to ANSI. One of our programs is throwing the exception "Type could not be marshaled because an embedded string could not be converted from Unicode to ANSI." It happens only if we use the Chinese version of the program. Why are we getting this exception? ...

Code
Jul 2, 2007
Post comments count0
Post likes count0

The conversations backstage at computer Go tournaments

Raymond Chen

Steve Rowe linked to an essay on why computers can't play Go well even though they've mastered other "difficult" games like chess. I was reminded of a description I received of what happens backstage at computer Go tournaments (i.e., tournaments that pit Go-playing computers against each other). ("Backstage" is a bit of a misnomer, of course; s...

Other
Jul 2, 2007
Post comments count0
Post likes count1

Image File Execution Options just inserts the debugger in front of the command line

Raymond Chen

If you use the Image File Execution Options registry key to force a program to run under the debugger, all the kernel does is insert the debugger in front of the command line. In other words, the function figure out what program is about to be run and checks the Image File Execution Options. If it finds a debugger, then the debugger is prepended ...

Other
Jun 29, 2007
Post comments count0
Post likes count1

Don't forget to pass the current directory along with the command line to your single-instance program

Raymond Chen

If you make a single-instance program, and somebody runs a second copy of the program and passes a command line, the most common way of handling this is to hand the command line to the first copy of the program and let the first copy deal with it. When you do this, don't forget about the current directory. If somebody passes a relative path to t...

Code
Jun 28, 2007
Post comments count0
Post likes count1

If it's optional, then don't make it mandatory

Raymond Chen

I was filling out an online form, and it gave me the option of providing feedback on the service I had received. The button was marked "optional", but I clicked it anyway because there were one or two things I thought were worthy of mentioning, suggestions on how they could improve the user's experience with the Web site, that sort of thing. What ...

Non-Computer
Jun 27, 2007
Post comments count0
Post likes count1

Those who do not understand the dialog manager are doomed to reimplement it, badly

Raymond Chen

A customer wanted to alter the behavior of a multi-line edit control so that it did not treat a press of the Tab key as a request to insert a tab character but rather treated it as a normal dialog navigation key. The approach the customer took was to subclass the edit control and intercept the Tab key: There are many things wrong with this appr...

Code
Jun 26, 2007
Post comments count0
Post likes count0

What's all this stuff hanging from that utility pole?

Raymond Chen

Brain Hayes, author of Infrastructure: A Field Guide to the Industrial Landscape (another example of the "short: long" book title fad), talks us through all of the wires hanging from what we commonly call a "telephone pole".

Non-Computer
Jun 26, 2007
Post comments count0
Post likes count1

Why do DLGC_WANTALLKEYS and DLGC_WANTMESSAGE have the same value?

Raymond Chen

From a purely theoretical point of view, there is only one "want" code you really need: . All the others are just conveniences. For example, returning means "I want this message if it is an arrow key; otherwise, I don't care." It lets you write instead of the more cumbersome (but equivalent) Similarly, is equivalent to returning if the me...

Code