Exercises

Exercise 22.1: Find the MFC code for DECLARE_SERIAL

Use Edit | Find in Files to search the C:\Program Files\Microsoft Visual Studio\VC98 directory and subdirectories for DECLARE_DYNAMIC. The line you are looking for is the one that starts with #define DECLARE_DYNAMIC; it lived in AFX.H, last time the author checked. Look at this and the other macros mentioned in this section, especially DECLARE_SERIAL and IMPLEMENT_SERIAL. Note that a macro definition can extend over several lines if the lines keep ending with a backslash \.

Exercise 22.2: The second 4 Gig problem

Since time returns a 32-bit integer, we can expect a Y2K kind of problem some four billion seconds after 1970. (You might think of it as the Second 4 Gig problem.) This is when the time function will start repeating itself. Get out your calculator and figure out the date of this instant.

Exercise 22.3: Initializing the randomizer

Run Pop and use File | New to open a new document. Use Window | Tile so you can see them both. Do they look the same? Try this with both the Release and the Debug builds of the code. Why is the behaviour different?



    Part I: Software Engineering and Computer Games
    Part II: Software Engineering and Computer Games Reference