Traditionally, the introductory C program example has always been a “Hello, World” message, provided by about a half-dozen lines of code. For Windows 98, however, the equivalent introductory example will be a bit more complex, requiring some 130+ lines of code—roughly 20 times longer. This difference is not so much because Windows is that much more complex than DOS, but more a reflection of the fact that any Windows application, even a rudimentary example, operates in a more complex environment than its DOS counterpart. Accordingly, the Windows application requires some minimal provisions to match this environment.
NOTE
Because Windows applications generally include image (bitmapped) resources that their DOS counterparts lack, direct comparisons of .EXE files sizes are generally not valid. The real differences in size are more readily apparent in terms of source code sizes and development times.
Still, the flip side of this coin does not mean that all applications will be larger and more complex than their DOS counterparts. More commonly, larger Windows applications will become smaller than their DOS counterparts because many functions and services that are supplied by the application itself under DOS are called externally as system functions under Windows.
Theory aside, however, the WinHello source example is considerably larger than its DOS counterpart. Its actual size depends on how the application was created. For example, WinHello, a simple application program using no class definitions, consists of one source file; while WinHello2, an MFC (Microsoft Foundation Class library) application created using AppWizard, has 20 source files.
NOTE
The WinHello and WinHello2 demos are included on the CD accompanying this book, in the Chapter 2 folder.