home *** CD-ROM | disk | FTP | other *** search
/ Mastering MFC Development / MMD.ISO / labs / c10 / lab01 / baseline / dataview.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-20  |  1.7 KB  |  63 lines

  1. // DataView.h : header file
  2. //
  3.  
  4. /////////////////////////////////////////////////////////////////////////////
  5. // CDataView view
  6. class CBrowserDoc;
  7.  
  8. class CDataView : public CListView
  9. {
  10. protected:
  11.     void SetParams( CDaoQueryDef * pQDef );
  12.     CDataView();           // protected constructor used by dynamic creation
  13.     DECLARE_DYNCREATE(CDataView)
  14.  
  15. // Attributes
  16. public:
  17.     void FindQueryData( CString & strCriteria );
  18.     void LoadData( CString * pstrCriteria = 0 );
  19.     void LoadHeaders( );
  20.     CBrowserDoc  * GetDocument( );
  21.     BOOL SetData( CDaoDatabase * pDB, const CString & name, const int nType );
  22.     CDaoDatabase * m_pDB;
  23.     CDaoRecordset * m_pRecordset;
  24.     CDaoQueryDef * m_pQuery;
  25.     CDaoTableDef * m_pTable;
  26.  
  27.     enum{ TABLE = 0, QUERY, FIND }; //Make the code more readable
  28.  
  29.     // Operations
  30. public:
  31.  
  32. // Overrides
  33.     // ClassWizard generated virtual function overrides
  34.     //{{AFX_VIRTUAL(CDataView)
  35.     protected:
  36.     virtual void OnDraw(CDC* pDC);      // overridden to draw this view
  37.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  38.     virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
  39.     //}}AFX_VIRTUAL
  40.  
  41. // Implementation
  42. protected:
  43.     virtual ~CDataView();
  44. #ifdef _DEBUG
  45.     virtual void AssertValid() const;
  46.     virtual void Dump(CDumpContext& dc) const;
  47. #endif
  48.  
  49.     // Generated message map functions
  50. protected:
  51.     //{{AFX_MSG(CDataView)
  52.     afx_msg void OnPageDown();
  53.     afx_msg void OnPageFirst();
  54.     afx_msg void OnPageLast();
  55.     afx_msg void OnPageUp();
  56.     afx_msg void OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult);
  57.     //}}AFX_MSG
  58.     afx_msg long OnHeadClick( UINT = 0, long = 0 );
  59.     DECLARE_MESSAGE_MAP()
  60. };
  61.  
  62. /////////////////////////////////////////////////////////////////////////////
  63.