The Old New Thing

Hey, let's report errors only when nothing is at stake!

Only an idiot would have parameter validation, and only an idiot would not have it. In an attempt to resolve this paradox, commenter Gabe suggested, "When running for your QA department, it should crash immediately; when running for your customer, it should silently keep going." A similar opinion was expressed by commenter Koro and some ...

Simulating input via WM_CHAR messages may fake out the recipient but it won't fake out the input system

We saw some time ago that you can't simulate keyboard input with Post­Message. You may get away with it, depending on how the application you're trying to fake out processes input, but since you're just faking data, the application may discover that it's all a ruse when they try to access information that you didn't fake out, say by ...
Comments are closed.0 0
Code

Luxurifying the camping experience in a different direction

Some time ago, I noted the increasing luxurification of camping, where people with more money than sense decide to go through the camping experience without building any of the character that comes with it. But that's not the only direction luxurification has moved. Unwilling to accept that "getting there is half the fun", some people take...

You don't need to ask me a question the compiler can answer more accurately

A customer reported having problems developing the correct p/invoke signature for the INPUT structure. "The code works on 32-bit machines, but on 64-bit machines, the call to Send­Input returns ERROR_INVALID_PARAMETER." The sample code included the lines My response was simply, "I bet you are passing the wrong structure size. Note ...
Comments are closed.0 0
Code

No, we're not going to play Stairway to Heaven, and please tell everbody else in your area code to stop calling me

Some time ago, I told the story of how one employee's phone received calls intended for a local radio station's contest line due to people dialing seven digits instead of ten and defaulting to the wrong area code. Upon reading that story, a colleague of mine pointed out that one of the conference rooms in his building has a similar problem. ...

How is it possible to run Wordpad by just typing its name even though it isn't on the PATH?

In a comment completely unrelated to the topic, Chris Capel asks how Wordpad manages to run when you type its name into the Run dialog even though the command prompt can't find it? In other words, the Run dialog manages to find Wordpad even though it's not on the PATH. Chris was unable to find anywhere I discussed this issue earlier, but it'...
Comments are closed.0 0
Code

How do I disable windowless control support in dialog boxes?

A customer wanted to know how to disable windowless control support in dialog boxes. "The customer has a CommandButton ActiveX control on his dialog box, and using Get­Dlg­Item to get the window handle of the command button succeeded with VC 6.0, but when compiled with VC 9.0, it does not create a window. I'm guessing that ...
Comments are closed.0 0
Code

Why is secur32.dll called secur32.dll and not secure32.dll?

Many years ago, in a discussion of why you shouldn't name your DLL "security.dll", I dug a bit into the history behind the DLL. Here are some other useless tidbits about that file. Originally, there were two DLLs called security.dll. One was the 32-bit version and one was the 16-bit version. They could coexist because the 32-bit version was ...

How do I find the original name of a hard link?

A customer asked, "Given a hardlink name, is it possible to get the original file name used to create it in the first place?" Recall that hard links create an alternate name for a file. Once that alternate name is created, there is no way to tell which is the original name and which is the new name. The new file does not have a "link back ...
Comments are closed.0 0
Code

Some mailing lists come with a negative service level agreement, but that's okay, because everybody is in on the joke

As I noted some time ago, there's a mailing list devoted to chatting among people who work in a particular cluster of buildings. It's not a technical support mailing list, but people will often ask a technical question on the off chance that somebody can help, in the same way that you might ask your friends for some help with something. Of ...

Feedback usabilla icon