Showing tag results for Code

Nov 2, 2006
Post comments count0
Post likes count0

Make sure you disable the correct window for modal UI

Raymond Chen
Raymond Chen

Some time ago, I was asked to look at two independent problems with people trying to do modal UI manually. Well, actually, when the issues were presented to me, they weren't described in quite that way. They were more along the lines of, "Something strange is happening in our UI. Can you help?" Only in the discussion of the scenarios did it become...

Code
Oct 23, 2006
Post comments count0
Post likes count1

Psychic debugging: Why doesn't my program show up when I call ShellExecute?

Raymond Chen
Raymond Chen

This question came in from a customer (paraphrased): If I run my program from the command prompt, it works great, but if I run it from my launcher via , it never appears. See how good your psychic powers are at solving this problem before I give you the second question that gives away the answer. Any luck? Here's a second question from a d...

Code
Oct 19, 2006
Post comments count0
Post likes count0

No good deed goes unpunished, part 2

Raymond Chen
Raymond Chen

Sometimes you're better off keeping your fool mouth shut. When I reply to a question on an internal discussion list, often with a clarifying question rather than an answer, it will occasionally happen that the person I replied to will send a response directly to me rather than including the discussion list. This is bad for a few reasons. When ...

CodeemailNo good deed goes unpunished
Oct 17, 2006
Post comments count0
Post likes count0

What does the letter "T" in LPTSTR stand for?

Raymond Chen
Raymond Chen

The "T" in comes from the "T" in . I don't know for certain, but it seems pretty likely that it stands for "text". By comparison, the "W" in probably comes from the C language standard, where it stands for "wide".

Code
Oct 12, 2006
Post comments count0
Post likes count0

How do I prevent multi-line edit controls from eating the Enter key?

Raymond Chen
Raymond Chen

You might decide to put a multi-line edit control in a dialog box, not because you want the user to input multi-line data, but because it's a convenient way to display multi-line text. When you do that, you may notice that the Enter key does not invoke the default dialog button, as you might normally expect. That's because the multi-line edit contr...

Code
Oct 10, 2006
Post comments count0
Post likes count0

When something is available for the user, which user are we talking about?

Raymond Chen
Raymond Chen

Some people have taken issue with the term for the name of the base of the message range that is the province of the window class implementor. (Refresher for those who forget which messages belong to whom.) The complaint is that the user can't use them since they belong to the window class. Aha, but the real question is, "Who is the user?" In oth...

Code
Oct 6, 2006
Post comments count0
Post likes count0

A very brief return to part 6 of Loading the Chinese/English dictionary

Raymond Chen
Raymond Chen

Back in Part 6 of the first phase of the "Chinese/English dictionary" series (a series which I intend to get back to someday but somehow that day never arrives), I left an exercise related to the member of the union. Alignment is one of those issues that people who grew up with a forgiving processor architecture tend to ignore. In this case,...

Code
Sep 28, 2006
Post comments count0
Post likes count0

When you crash, make sure you crash in the right place

Raymond Chen
Raymond Chen

Last time, I recommended that functions should just crash when given invalid pointers. There's a subtlety to this advice, however, and that's making sure you crash in the right place. If your function and your function's caller both reside on the same side of a security boundary, then go ahead and crash inside your function. If the caller is a bad...

Code
Sep 26, 2006
Post comments count0
Post likes count0

Isn't DDE all asynchronous anyway?

Raymond Chen
Raymond Chen

"Isn't DDE all asynchronous anyway?" asks commenter KaiArnold. It's mostly asynchronous, but not entirely. You can read about how DDE works in MSDN, but since it seems people are reluctant to read the formal documentation, I'll repeat here the points relevant to the discussion. The DDE process begins with a search for a service provider. This i...

Code