ATL Development   «Prev 

Adding Application Data

Here are the steps to add internal member variables and methods to CPhBookObj to support storing and managing PhRec structures:
  1. To add an array of PhRecs to CPhBookObj, right-click CPhBookObj in the ClassView pane of the Workspace window.
  2. Select Add Member Variable... to bring up the Add Member Variable dialog.
  3. In the Add Member Variable dialog, type PhRec for Variable Type and m_PhRecs[MAX_RECS] for Variable Name, and check Protected. When you are done, click OK.
  4. The variable m_PhRecs is added to the Class View under CPhBookObj. The next step is to add the member variable m_numrecs to hold the value of the number of records currently stored in m_PhRecs. Right-click CPhBookObj in the ClassView pane of the Workspace window.
  5. Select Add Member Variable... to open the Add Member Variable dialog.
  6. Type in long for Variable Type, and m_numrecs for Variable Name, and check Protected. When you are done, click OK.
  7. The variable m_numrecs is added to the Class View under CPhBookObj. Now let's add member variable m_currec to hold the value of the CurRec property. A value of -1 indicates that CurRec is not set. Right-click CPhBookObj in the ClassView pane of the Workspace window.
  8. Select Add Member Variable... to bring up the Add Member Variable dialog.
  9. In the Add Member Variable dialog, type long for Variable Type, and m_currec for Variable Name, and check Protected. When you are done, click OK.
  10. The member variable m_currec is added to the Class View under CPhBookObj. This is the end of the simulation.