Flylib.com

Books Software

 
 
 

WHAT YOU NEED TO BEGIN


WHAT YOU NEED TO BEGIN

You need to download Visual C++ 2005 Express Edition, available at the time of this writing at http://lab.msdn.microsoft.com/express/visualc/. Alternatively, you can order a CD online from http://lab.msdn.microsoft.com/vs2005/get/order/. In addition, you need the following:

  • PC with a speed of at least 600MHz (1GHz recommended)

  • Windows XP, Windows 2000, or Windows 2003 Server

  • At least 128MB of Random Access Memory (RAM) (256MB recommended)

  • At least 1.3GB of hard disk space

  • A display capable of 800×600 256 colors (1024×768 high color , 16-bit recommended)

  • Microsoft mouse or compatible pointing device

A CD or DVD drive is required.



SPECIAL FEATURES OF THIS BOOK

As you learn the language, my goal is to make the process fun, fast, and interesting. Every chapter includes games for the sample programs. At the end of each chapter are challenges to help you hone your skills. This book also includes the following special elements:

Hint 

This is where I'll put hints or advice I've learned that can help make your programs lean and mean and Visual C++ easier to use.

Trap 

Traps cover common mistakes and problem areas, particularly those that snare new programmers.

Trick 

These are shortcuts that I've found, including how to go beyond the rules after you've mastered them.

image from book
IN THE REAL WORLD

In these sidebars, I share with you many of the experiences I've had while learning C++ and using it in the world of game and business application programming.

image from book



Chapter 1: An Introduction to Visual C++ 2005 Express

OVERVIEW

With the release of Visual C++ 2005 Express Edition, Microsoft has turned its attention to the needs of a new generation of programmers. The changes that Microsoft has made respond to the growing need of programmers to quickly develop applications that are robust and able to work on multiple platforms. With the seamless integration of the .NET Framework, Visual C++ developers now enjoy the ability to create applications that can run under the Windows operating system, as the core of a server-side applet, or on many other platforms.

This chapter begins your process of becoming a C++ programmer by covering information that orients you to the C++ language, Visual C++, and the .NET Framework. When you're finished with this chapter, you'll be ready to dive right in and create your first program. By developing this application, you'll gain a sense of the steps required to build a program and some of the strengths of developing using the Visual C++ toolset.

In this chapter, you learn the following:

  • What Visual C++ 2005 Express is and what it can do

  • What .NET is and how it works with Visual C++ 2005 Express

  • What Visual Studio is and how Visual C++ fits into it

  • What the five basic steps are to building a Visual C++ application



PROJECT PREVIEW: THE JOKE MACHINE

In this chapter, as with each chapter to follow, you learn how to create a Visual C++ application. Each chapter provides a simple, fun way to learn the language, introduce you to the various tools you need to create each program, and give you a foundation on which to expand your knowledge of C++ and the .NET Framework.

The application that you learn to create in this chapter is a simple program called the Joke Machine. Its purpose is to display to the user two jokes. It is a fully functional Windows application, complete with buttons for closing and minimizing the program, buttons associated with each of the two jokes, and a text box used for displaying the jokes. Although the program is easy to develop, it illustrates the powerful techniques for designing and programming Windows applications.

When you first launch the Joke Machine, it appears in a window, as shown in Figure 1.1.

image from book
Figure 1.1: The starting screen of the Joke Machine.

Figure 1.2 shows the result of causing the Joke Machine to tell the first joke.

image from book
Figure 1.2: Clicking the first button triggers the first joke.

Figure 1.3 displays the result of clicking the second joke.

image from book
Figure 1.3: Clicking the second button triggers the second joke.