home *** CD-ROM | disk | FTP | other *** search
/ Master Visual C++ 1.5 / MASTERVC15.ISO / vcprog / original / ch14 / phn / phone.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-21  |  638 b   |  39 lines

  1. //////////////////////
  2. // MY CODE STARTS HERE
  3. //////////////////////
  4.  
  5. // PHONE.CPP
  6. //
  7. // Implementation file of the CPhone class.
  8.  
  9.  
  10. #include "stdafx.h"
  11. #include "phone.h"
  12.  
  13. // Needed for serialization.
  14. IMPLEMENT_SERIAL(CPhone, CObject, 0)
  15.  
  16. // Constructor.
  17. CPhone::CPhone()
  18. {
  19.    m_Name  = "";
  20.    m_Phone = "";
  21. }
  22.  
  23. // Serialize function of the CPhone class.
  24. void CPhone::Serialize(CArchive& ar)
  25. {
  26.      if (ar.IsStoring())
  27.         {
  28.         ar << m_Name << m_Phone;
  29.         }
  30.      else
  31.         {
  32.         ar >> m_Name >> m_Phone;
  33.         }
  34. }
  35.  
  36. ////////////////////
  37. // MY CODE ENDS HERE
  38. ////////////////////
  39.