Congratulations! You have completed the first step on the road to becoming a Visual C++ programmer. This chapter has covered a lot of ground for an introductory chapter, but don't worry if you didn't understand all the details. If you stay focused on the larger picture, the material will become much more intuitive and natural.
In this chapter, you learned about what Visual C++ 2005 Express is and what it is not. You also learned a bit of the history behind Visual C++ and where it fits into the Microsoft Visual Studio line of products. This chapter also covered the .NET Framework, including how it works and how Visual Studio products make use of it.
In addition, you learned the five basic steps involved in developing a Visual C++ application. You then put this information together and developed your first Visual C++ application, the Joke Machine.
Before you move on to the
Improve the Joke Machine by adding new
The Joke Machine currently displays only the text string of Form1 in the Windows title bar. Replace this text string with the phrase The Joke Machine. (Hint: Click on the form and modify the form's Text property.)
The Joke Machine's TextBox field currently allows the entry of text. Technically, it should display only jokes. Prevent the text box from accepting text. (Hint: Click on the TextBox1 control and set the Readonly property to True. )
The key to building programs quickly and effectively in Visual C++ is to be familiar with the Integrated Development Environment (IDE). Now that you know the capabilities of Visual C++ 2005 Express Edition, it is time to familiarize yourself with how the IDE works. In this chapter, you will learn about the most common and widely used elements that make up the IDE and how to use them.
In this chapter, you learn the following:
How to work with the IDE menu and standard toolbar
What the basics are of working with the Form Designer and Code Editor
What IntelliSense is and how to use it to your advantage
How to work with the Toolbox, Solution Explorer, and Properties
The game project that you learn to develop in this chapter is called the
Click Race
game. The object of this simple game is for the player to see how many clicks he can score in 30 seconds. Two buttons are provided, but because simply clicking is a bit easy, the game challenges the player by forcing him to alternate between the two buttons. To play well, the player must be able to quickly switch between
The
Click Race
game starts up as shown in Figure 2.1. The game buttons that the
Figure 2.1:
Starting up the Click Race game.
The game begins when the player selects the Start Game button. When this happens, the game button on the left side of the window is enabled, as demonstrated in Figure 2.2.
Figure 2.2:
Players score points by clicking on the currently active game button.
The player scores a point by clicking on the button. After the button is clicked, the left game button is disabled and the right game button is enabled, as demonstrated in Figure 2.3.
Figure 2.3:
To score another point, the player must click on the second game button.
The Click Race game allows the player to score as many points as possible within a 30-second period. Gameplay stops at 30 seconds when both game buttons are disabled. The total number of points scored by the player is displayed, as demonstrated in Figure 2.4.
Figure 2.4:
Plays ends at 30 seconds when both game buttons are disabled.
After you have successfully created the Click Race game, you'll have learned how to build a program that dynamically responds to events that the player generates. You'll also have learned how to work with the Visual C++ Timer control.