The Old New Thing

Notes on gift card and gift certificates in the state of Washington

Today is the unofficial start of the holiday shopping season. One of my colleagues read the fine print of a gift card he received: A monthly maintenance fee of $3 applies but is waived for the first twelve months after the card is issued. Thereafter, monthly maintenance fees are waived for an additional three months if the card is used in any...

Why can't I create my dialog with DialogBox, DialogBoxParam, CreateDialog, CreateDialogParam, or the indirect versions of same?

One of the purposes of my dialog manager series was to help people diagnose problems with their dialog boxes. But since I embedded the tips inside the series body, it's hard for people to find them, and I still end up answering the same questions over and over. So here it is in a separate article that hopefully people can find. Why your ...
Comments are closed.0 0
Code

Things that can happen when your kitchen gets taken over by others

Today is the Thanksgiving holiday in the United States, one of the the major holidays for family get-togethers. (Another big one is Christmas.) One year, it was our family's turn to host Thanksgiving, and when that happens, it means that the kitchen is overrun by relatives cooking all the dishes and hunting through the cabinets and drawers of ...

If you try to declare a variadic function with an incompatible calling convention, the compiler secretly converts it to cdecl

Consider the following function on an x86 system: The function declares itself as __stdcall, which is a callee-clean convention. But a variadic function cannot be callee-clean since the callee does not know how many parameters were passed, so it doesn't know how many it should clean. The Microsoft Visual Studio C/C++ compiler resolves ...
Comments are closed.0 0
Code

The case of the DLL that refuses to load

A customer reported that they had a problem that occurred only on some machines but not others. Their application called and the call succeeded on some machines, but failed on others with error ERROR_MOD_NOT_FOUND ("The specified module could not be found"). The path was a fully-qualified path to a file that was confirmed to exist and be ...
Comments are closed.0 0
Code

Why did Raymond bring a knitting bag to every meeting?

I stopped knitting a few years ago, but back when I knitted regularly, I tended to bring my knitting bag with me everywhere I went. There are a lot of idle minutes in your typical day. Waiting for the bus, waiting in line for the ATM, waiting for a meeting to start. There's not enough time in those idle minutes to do anything substantial, but...

My friend lived in an apartment inside a museum

One evening, I had a series of three dreams. In each one, I visited an unusual home. In the second dream, I visited the home of a friend of mine. She lived in a modern luxury apartment inside an art museum. It was a little tricky, because you could visit her only during museum hours. If you stayed past closing time, then you were locked ...

Extracting GPS coordinates from a photo and plotting it on a map

Today's Little Program extracts GPS coordinates from a photo and plots it on a map. Remember, Little Programs do little to no error checking, because that's how they roll. We start with a simple function that takes a latitude and longitude and opens a Web page that highlights that coordinate. In a real program, you probably would do ...
Comments are closed.0 0
Code

How do I get the effect of CW_USEDEFAULT positioning on a window I've already created?

A customer wanted to know how to get the effect of CW_USE­DEFAULT positioning on a window that already exists. In particular, they wanted to be able to reposition a dialog box to get the CW_USE­DEFAULT cascade effect, but since you can't actually pass CW_USE­DEFAULT in a dialog template, the repositioning has to be done after the...
Comments are closed.0 0
Code

How do I get the path to the default user's profile?

A customer wanted to know how to get the path to the default user's profile. On older versions of Windows, the default location of the default user's profile was C:\WINNT\Profiles\Default. Then it moved to C:\Documents and Settings\Default User. Now it's in C:\Users\Default. And the location may have been customized, so in principle it could ...
Comments are closed.0 0
Code

Feedback usabilla icon