Appendix A From 16-Bit Windows to 32-Bit Windows

For many programmers, a topic of immediate interest will be how to transport existing applications originally written for the 16-bit Windows 3.x (Win16) to the 32-bit Windows 98 and Windows NT (Win32) environments. Fortunately, such conversions, although sometimes tedious, can be relatively simple.

Because both Windows 3.x and 98/95/NT follow the same general structural format, use the same messaging systems, and employ the same resource elements, the overall structure being moved from Windows 3.x to 98/95/NT does not change. For the most part, existing Windows 3.x applications will run directly under Windows 98/95/NT without requiring recompilation for the 32-bit environment.

This compatibility is provided by a translation feature in Windows 98/95/NT that interprets 16-bit API function calls and message structures into 32-bit formats, and translates 32-bit messages and data formats into their 16-bit equivalents. The result, as you might expect, is a less efficient program. And depending on the circumstances, the result may also be a slower execution, which may or may not be viewed as acceptable.

Alternatively, you can avoid such problems with 16-bit applications by converting and recompiling them using the Windows 98/95/NT format with a suitable 32-bit compiler. Still, transforming applications from Windows 3.x 16-bit formats to the 98/95/NT 32-bit format requires more than simply a change of compilers.

Although the tasks accomplished under Windows 3.x and under Windows 98/95/NT are essentially the same, the manner in which these are executed and the formats in which information is handled present several differences. These differences must be taken into account when you are converting an application from the 16-bit to the 32-bit environment.

This appendix provides an overview of some common programming changes you need to be aware of when you convert programs from Windows 3.x to 98/95/NT. It does not cover all the possibilities—just the more common ones you are likely to encounter. No single program can illustrate all the relevant changes necessary, so program fragments have been used to illustrate specific topics.

© 1998 SYBEX Inc. All rights reserved.