home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / genre.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  3KB  |  98 lines

  1. /***********************************************************************
  2. **      G E N R E . H                                                  *
  3. **                                                                     *
  4. ************************************************************************
  5. ** Copyright (C) 1996 by Microsoft Corporation                         *
  6. **                 All Rights Reserved                                 *
  7. ************************************************************************/
  8. /*
  9.  
  10.         GENRE.H
  11.  
  12.         Genre record object class definitions for Microsoft Guide
  13.  
  14.  
  15.  
  16. */
  17.  
  18.  
  19.  
  20. #ifndef _GENRE_H_
  21. #define _GENRE_H_
  22.  
  23. /*
  24.  
  25. Genre objects are constructed from database records of the Genre table.
  26.  
  27. The CGenreRecordset class is used to select and create CGenre objects
  28. from the Genre table via functions in the CDatabaseRecordset parent class.
  29.  
  30. */
  31.  
  32.  
  33. #include "dbsets.h"
  34.  
  35.  
  36.  
  37. class COMMMSTVEXPORT CGenreRecordset : public CDatabaseRecordset
  38. {
  39.  
  40. // This class provides Genre recordset manipulation via parent functions
  41.  
  42.  
  43. virtual CString GetTableName( VOID);
  44.  
  45. virtual BOOL    SetRecordsetObject( VOID* cRecordsetObject);
  46.  
  47. public:
  48. virtual VOID*   GetRecordsetObject( VOID);
  49. virtual BOOLEAN Seek(LPCTSTR lpszComparison, CObject &coo);
  50. virtual BOOLEAN Seek(LPCTSTR lpszComparison, LONG lGenreID);
  51. };
  52.  
  53.  
  54.  
  55.  
  56. class COMMMSTVEXPORT CGenre : public CObject
  57. {
  58.     friend class CGenreRecordset; // generates the CGenre record object
  59.  
  60. private:
  61.  
  62.     LONG            m_lGenreID;
  63.     LONG            m_lTuningSpace;
  64.     CString         m_cszName;
  65.  
  66. public:
  67.  
  68.     CGenre(LONG lGenreID = AFX_RFX_LONG_PSEUDO_NULL,
  69.             LONG lTuningSpace = 0,
  70.             CString cszName = "") :
  71.             m_lGenreID(lGenreID),
  72.             m_lTuningSpace(lTuningSpace),
  73.             m_cszName(cszName) { }
  74.  
  75.     ~CGenre(VOID) { }
  76.  
  77.     VOID    SetTuningSpace( LONG lTuningSpace) { m_lTuningSpace = lTuningSpace; }
  78.     VOID    SetName( LPCTSTR cszName) { m_cszName = cszName; }
  79.  
  80.     LONG               GenreID() { return m_lGenreID; }
  81.     LONG            TuningSpace() { return m_lTuningSpace; }
  82.     CString         Name() { return m_cszName; }
  83. };
  84.  
  85.  
  86. // Table: Genre
  87.  
  88. #define  TBL_Genre  _T("Genre")
  89.  
  90. //      Field:                      Index   Name             Type    Size
  91.  
  92. #define FLD_Genre_GenreID        _T("G Genre ID")        // GenreID          long      4
  93. #define FLD_Genre_TuningSpace    _T("G Tuning Space")    // Tuning Space        long      4
  94. #define FLD_Genre_Name            _T("G Name")            // Title            Text     50
  95.  
  96. #endif
  97.  
  98.