The SHOWDIB Sample Program

To illustrate the migration process with real code, this migration guide uses the SHOWDIB application. SHOWDIB is a Windows SDK sample application available with both Visual C++ 1.5 (16 bit) and Visual C++ 2.0 (32 bit). Both versions are also supplied on the disk accompanying this Migration Kit.

SHOWDIB lets you load, print, manipulate, and save bitmap files in the device independent bitmap (DIB) format. Unlike ordinary bitmaps, DIBs don't require that you furnish versions of the same bitmap for different screen resolutions. A bitmap stores information about each pixel in the image. DIBs store the bits of the image plus a color table, which makes them independent of any particular device. Figure 2 shows SHOWDIB's user interface.

Although SHOWDIB is not the most interesting application in the world (nor the most elegant), it has some advantages for the purposes of this migration guide. First, it's available in both 16-bit and 32-bit versions. Second, it's large enough to be interesting as a conversion target but small enough to be manageable in a relatively short guide. Finally, as the backbone of the guide, it's something you can use to walk through the process in a reasonable amount of time before you attempt converting one of your own applications.

The code examples presented in the guide are from the 32-bit version of SHOWDIB. Pertinent differences between the 16-bit and 32-bit versions will be pointed out as they come up.