In this lesson, we will add internal member variables and methods to
CPhBookObj
to support storing and managing
PhRec
structures.
The first step is to add a constant for the maximum number of phone records. Open PhBookObj.h and add
#define MAX_RECS 32
after
#include resource.h
.
After we've added the constant for the maximum number of phone records, we have to:
- Add an array of
PhRecs
to CPhBookObj
- Add a member variable,
m_numrecs
, to hold the number of records currently stored in m_PhRecs
- Add member variable
m_currec
to hold the value of the CurRec
property; a value of -1
indicates that CurRec
is not set