Appendix A. Using the Sample Programs

The book’s support Web site (www.jmhartsoftware.com) contains a zip file (the Examples file) with the source code for all the sample programs as well as the include files, utility functions, projects, and executables. A number of programs illustrate additional features and solve specific exercises, although the Examples file does not include solutions for all exercises or show every alternative implementation.

• All programs have been tested on Windows 7, Vista, XP, Server 2008, and Server 2003 on a wide variety of systems, ranging from laptops to servers. Where appropriate, they have also been tested at one time or another under Windows 9x, although many programs, especially those from later chapters, will not run on Windows 9x or even on NT 4.0, which is also obsolete.

• With a few minor exceptions, nearly all programs compile without warning messages under Microsoft Visual Studio 2005 and 2008 using warning level 3. Visual Studio 2010 (a beta version) easily converted several programs.

• Distinct project directories are provided for Microsoft Visual Studio 2005 and 2008 (32- and 64-bit). The three project directories are Projects2005, Projects2008, and Projects2008_64. The projects build the executable programs in the run2005, run2008, and run2008_64 directories, respectively. VS 2010 project and run directories will appear in an updated Examples file after VS 2010 is released.

• There is a separate zip file with Visual Studio C++ 6.0 and 7.0 projects; some readers may find these projects convenient, but they are not up to date.

• The generic C library functions are used extensively, as are compiler-specific keywords such as __try, __except, and __leave. The multithreaded C runtime library, _beginthreadex, and _endthreadex are essential starting with Chapter 7.

• The projects are in release, not debug, form. The projects are all very simple, with minimal dependencies, and can also be created quickly with the desired configuration and as either debug or release versions.

• The projects are defined to build all programs, with the exception of static or dynamic libraries, as console applications.

You can also build the programs using open source development tools, such as gcc and g++ in the Gnu Compiler Collection (http://gcc.gnu.org/). Readers interested in these tools should look at the MinGW open source project (www.mingw.org), which describes MinGW as “a port of the GNU Compiler Collection (GCC), and GNU Binutils, for use in the development of native Microsoft Windows applications.” I have tested only a few of the programs using these tools, but I have had considerable success using MinGW and have even been able to cross-build, constructing Windows executable programs and DLLs on a Linux system. Furthermore, I’ve found that gcc and g++ provide very useful 64-bit warning and error messages.

Examples File Organization

The primary directory is named WSP4_Examples (“Windows System Programming, Edition 4 Examples”), and this directory can be copied directly to your hard disk. There is a source file subdirectory for each chapter. All include files are in the Include directory, and the Utility directory contains the common functions such as ReportError. Complete projects are in the project directories. Executables and DLLs for all projects are in the run directories.

Download WindowsSmpEd3 (“Windows Sample Programs, Edition 3”) if you want to use Visual Studio 6 or Visual Studio 7.

ReadMe.txt

Everything else you need to know is in the ReadMe.txt file, where you will find information about:

• The directories and their contents

• The source code, chapter by chapter

• The include files

• Utility functions

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset