home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / database / daoview / listview.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  2.5 KB  |  87 lines

  1. // samplvw.h : interface of the CDaoListView class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. class CDaoListView : public CListView
  14. {
  15. protected: // create from serialization only
  16.     CDaoListView();
  17.     DECLARE_DYNCREATE(CDaoListView)
  18.  
  19. // Attributes
  20. public:
  21.     CDaoViewDoc* GetDocument();
  22.     CDaoDatabase* m_pDB;
  23.  
  24. // Operations
  25. public:
  26.     void EraseList();
  27.     void ShowDatabase();
  28.     void ShowIndexes(LPCTSTR strTableName,LPCTSTR strIndexName = NULL);
  29.     void ShowRelations(LPCTSTR strRelationName = NULL);
  30.     void ShowTableSchema(LPCTSTR strTableDefName = NULL);
  31.     void ShowTableData(LPCTSTR strTableName);
  32.     void ShowQuerySchema(LPCTSTR strQueryDefName = NULL);
  33.     void RunQueryDef(LPCTSTR strQueryDefName);
  34.     void ShowFields(LPCTSTR strTableName,LPCTSTR strFieldName = NULL);
  35.  
  36. protected:
  37.     void ShowDatabaseInfo(int nItem,CDaoDatabaseInfo& Info);
  38.     void ShowIndexInfo(int nItem,CDaoIndexInfo& Info);
  39.     void ShowRelationInfo(int nItem,CDaoRelationInfo& Info);
  40.     void ShowTableDefInfo(int nItem,CDaoTableDefInfo& tInfo);
  41.     void ShowQueryDefInfo(int nItem,CDaoQueryDefInfo& qdInfo);
  42.     void ShowFieldInfo(int nItem,CDaoFieldInfo& fInfo);
  43.     void DisplayColumnHeadings(UINT nStringID);
  44.     void AdjustColumnWidths();
  45.     void AddItem(int nItem,int nSubItem,LPCTSTR strItem);
  46.  
  47.     LPCTSTR CrackBOOL(BOOL bFlag);
  48.     LPCTSTR CrackFieldType(short sType);
  49.     LPCTSTR CrackQueryDefType(short sType);
  50.     CString CrackVARIANT(COleVariant& var);
  51.  
  52.     int m_nColumns;
  53.     BOOL m_bVertical;
  54.  
  55. // Overrides
  56.     // ClassWizard generated virtual function overrides
  57.     //{{AFX_VIRTUAL(CDaoListView)
  58.     public:
  59.     virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  60.     protected:
  61.     //}}AFX_VIRTUAL
  62.  
  63. // Implementation
  64. public:
  65.     virtual ~CDaoListView();
  66. #ifdef _DEBUG
  67.     virtual void AssertValid() const;
  68.     virtual void Dump(CDumpContext& dc) const;
  69. #endif
  70.  
  71. protected:
  72.  
  73. // Generated message map functions
  74. protected:
  75.     //{{AFX_MSG(CDaoListView)
  76.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  77.     //}}AFX_MSG
  78.     DECLARE_MESSAGE_MAP()
  79. };
  80.  
  81. /*
  82. #ifndef _DEBUG  // debug version in samplvw.cpp
  83. inline CSampleDoc* CDaoListView::GetDocument()
  84.    { return (CSampleDoc*)m_pDocument; }
  85. #endif
  86. */
  87.