home *** CD-ROM | disk | FTP | other *** search
/ Mastering MFC Development / MMD.ISO / labs / c10 / lab01 / ex05 / dataview.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-20  |  1.8 KB  |  65 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.     BOOL AttachTable(  );
  12.     void SetParams( CDaoQueryDef * pQDef );
  13.     CDataView();           // protected constructor used by dynamic creation
  14.     DECLARE_DYNCREATE(CDataView)
  15.  
  16. // Attributes
  17. public:
  18.     void FindQueryData( CString & strCriteria );
  19.     void LoadData( CString * pstrCriteria = 0 );
  20.     void LoadHeaders( );
  21.     CBrowserDoc  * GetDocument( );
  22.     BOOL SetData( CDaoDatabase * pDB, const CString & name, const int nType );
  23.     CDaoDatabase * m_pDB;
  24.     CDaoRecordset * m_pRecordset;
  25.     CDaoQueryDef * m_pQuery;
  26.     CDaoTableDef * m_pTable;
  27.     CString m_strAttached;
  28.  
  29.     enum{ TABLE = 0, QUERY, FIND, ATTACH }; //Make the code more readable
  30.  
  31.     // Operations
  32. public:
  33.  
  34. // Overrides
  35.     // ClassWizard generated virtual function overrides
  36.     //{{AFX_VIRTUAL(CDataView)
  37.     protected:
  38.     virtual void OnDraw(CDC* pDC);      // overridden to draw this view
  39.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  40.     virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
  41.     //}}AFX_VIRTUAL
  42.  
  43. // Implementation
  44. protected:
  45.     virtual ~CDataView();
  46. #ifdef _DEBUG
  47.     virtual void AssertValid() const;
  48.     virtual void Dump(CDumpContext& dc) const;
  49. #endif
  50.  
  51.     // Generated message map functions
  52. protected:
  53.     //{{AFX_MSG(CDataView)
  54.     afx_msg void OnPageDown();
  55.     afx_msg void OnPageFirst();
  56.     afx_msg void OnPageLast();
  57.     afx_msg void OnPageUp();
  58.     afx_msg void OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult);
  59.     //}}AFX_MSG
  60.     afx_msg long OnHeadClick( UINT = 0, long = 0 );
  61.     DECLARE_MESSAGE_MAP()
  62. };
  63.  
  64. /////////////////////////////////////////////////////////////////////////////
  65.