Showing archive results for 2003

Nov 13, 2003
Post comments count0
Post likes count0

British newspapers are much more fun to read

Raymond Chen

You can always count on The Register for a snarky take on the day's technology news. Today's favorite is this "review" of the nTAG, which ends with Well, we think that any sane person would have to held at gunpoint to induce them to carry an electronic device which, besides containing personal or othe...

Non-Computer
Nov 13, 2003
Post comments count0
Post likes count0

Another different type of dialog procedure

Raymond Chen

The other method of using a window-procedure-like dialog box is to change the rules of the game. Normally, the window procedure for a dialog box is the function, which calls the dialog procedure and then takes action if the dialog procedure indicated that it desired the default action to take place. The dialog procedure is subservient to , prov...

Code
Nov 13, 2003
Post comments count0
Post likes count0

Answer to previous exercise about m_fRecursing

Raymond Chen

Answer to previous exercise: The flag does not need to be per-instance. It only needs to be valid long enough that the recursive call that comes immediately afterwards can be detected. However, a global variable would not work because two threads might be inside the recursive call simultaneously. But a thread-local variable would work. (If you...

Code
Nov 12, 2003
Post comments count0
Post likes count0

A different type of dialog procedure

Raymond Chen

In the discussion following my entry about dialog procedure return values, somebody suggested an alternate dialog design where you just call to do default actions (the same way you write window procedures and ) rather than returning TRUE/FALSE. So let's do that. In fact, we're going to do it twice. I'll cover one method today and cover an enti...

Code
Nov 11, 2003
Post comments count0
Post likes count0

Welcome Martyn Lovell

Raymond Chen

Martyn Lovell from the VC++ team has joined the world of blogging. Martyn is a smart guy, even though he does spell some words funny.

Other
Nov 11, 2003
Post comments count0
Post likes count0

Safer subclassing

Raymond Chen

Answer to yesterday's homework assignment, with discussion.

Code
Nov 10, 2003
Post comments count0
Post likes count0

Homework assignment about window subclassing

Raymond Chen

Window subclassing is trickier than you think. Consider this code sketch: What could go wrong? We'll discuss it tomorrow.

Code
Nov 10, 2003
Post comments count0
Post likes count0

How much do you expect from a framework layer?

Raymond Chen

If a framework exposes functionality provided by a lower layer, how hard should the framework try to insulate you from all the quirks and limitations of the lower layer? Instinctively, of course, you would say, "The framework should insulate me completely." But be careful what you ask for. If a frame...

Other
Nov 10, 2003
Post comments count0
Post likes count0

A warning to people averse to code

Raymond Chen

This is going to be a code-heavy week. People who are averse to code may want to just lie low until next week. I'll try to make it up by having next week be more storytelling-focused.

Other
Nov 7, 2003
Post comments count0
Post likes count0

Returning values from a dialog procedure

Raymond Chen

For some reason, the way values are returned from a dialog procedure confuses people, so I'm going to try to explain it a different way. The trick with dialog box procedures is realizing that they actually need to return two pieces of information: Since tw...

Code