home *** CD-ROM | disk | FTP | other *** search
/ Mastering MFC Development / MMD.ISO / labs / c10 / lab01 / ex05baseline / dataview.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-20  |  1.8 KB  |  66 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.     //Ex05 add another enumerator, ATTACH
  30.     enum{ TABLE = 0, QUERY, FIND }; //Make the code more readable
  31.  
  32.     // Operations
  33. public:
  34.  
  35. // Overrides
  36.     // ClassWizard generated virtual function overrides
  37.     //{{AFX_VIRTUAL(CDataView)
  38.     protected:
  39.     virtual void OnDraw(CDC* pDC);      // overridden to draw this view
  40.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  41.     virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
  42.     //}}AFX_VIRTUAL
  43.  
  44. // Implementation
  45. protected:
  46.     virtual ~CDataView();
  47. #ifdef _DEBUG
  48.     virtual void AssertValid() const;
  49.     virtual void Dump(CDumpContext& dc) const;
  50. #endif
  51.  
  52.     // Generated message map functions
  53. protected:
  54.     //{{AFX_MSG(CDataView)
  55.     afx_msg void OnPageDown();
  56.     afx_msg void OnPageFirst();
  57.     afx_msg void OnPageLast();
  58.     afx_msg void OnPageUp();
  59.     afx_msg void OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult);
  60.     //}}AFX_MSG
  61.     afx_msg long OnHeadClick( UINT = 0, long = 0 );
  62.     DECLARE_MESSAGE_MAP()
  63. };
  64.  
  65. /////////////////////////////////////////////////////////////////////////////
  66.