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

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10.  
  11. #ifndef __AFXOLEDB_H__
  12. #define __AFXOLEDB_H__
  13.  
  14. #ifdef _AFX_NO_DAO_SUPPORT
  15.     #error OLE DB classes not supported in this library variant.
  16. #endif
  17.  
  18. #ifndef __AFXEXT_H__
  19.     #include <afxext.h>
  20. #endif
  21.  
  22. #include <atlbase.h>
  23.  
  24. // application is expected to provide a _Module
  25. extern CComModule _Module;
  26.  
  27. #include <atlcom.h>
  28. #include <atldbcli.h>
  29.  
  30. #ifdef _AFX_MINREBUILD
  31. #pragma component(minrebuild, off)
  32. #endif
  33. #ifndef _AFX_FULLTYPEINFO
  34. #pragma component(mintypeinfo, on)
  35. #endif
  36.  
  37. /////////////////////////////////////////////////////////////////////////////
  38. // Win32 libraries
  39.  
  40. #ifndef _AFX_NOFORCE_LIBS
  41. #ifdef _AFXDLL
  42.     #if defined(_DEBUG) && !defined(_AFX_MONOLITHIC)
  43.         #ifndef _UNICODE
  44.             #pragma comment(lib, "mfco42d.lib")
  45.             #pragma comment(lib, "mfcd42d.lib")
  46.         #else
  47.             #pragma comment(lib, "mfco42ud.lib")
  48.             #pragma comment(lib, "mfcd42ud.lib")
  49.         #endif
  50.     #endif
  51. #endif
  52. #endif
  53.  
  54. #ifdef _AFX_PACKING
  55. #pragma pack(push, _AFX_PACKING)
  56. #endif
  57.  
  58. /////////////////////////////////////////////////////////////////////////////
  59.  
  60. //CObject
  61.     //CCmdTarget;
  62.         //CWnd
  63.             //CView
  64.                 //CScrollView
  65.                     //CFormView
  66.                         class COleDBRecordView; // view records with a form
  67.  
  68. /////////////////////////////////////////////////////////////////////////////
  69.  
  70. #undef AFX_DATA
  71. #define AFX_DATA AFX_DB_DATA
  72.  
  73. /////////////////////////////////////////////////////////////////////////////
  74. // CRecordView - form for viewing data records
  75.  
  76. class COleDBRecordView : public CFormView
  77. {
  78.     DECLARE_DYNAMIC(COleDBRecordView)
  79.  
  80. // Construction
  81. protected:  // must derive your own class
  82.     COleDBRecordView(LPCTSTR lpszTemplateName)
  83.         : CFormView(lpszTemplateName)
  84.     {
  85.         m_bOnFirstRecord = TRUE;
  86.         m_bOnLastRecord = FALSE;
  87.     }
  88.     COleDBRecordView(UINT nIDTemplate)
  89.         : CFormView(nIDTemplate)
  90.     {
  91.         m_bOnFirstRecord = TRUE;
  92.         m_bOnLastRecord = FALSE;
  93.     }
  94.  
  95. // Attributes
  96. public:
  97.     virtual CRowset* OnGetRowset() = 0;
  98.  
  99. // Operations
  100. public:
  101.     virtual BOOL OnMove(UINT nIDMoveCommand);
  102.  
  103. // Implementation
  104. public:
  105.     virtual void OnInitialUpdate();
  106.  
  107. protected:
  108.     BOOL m_bOnFirstRecord;
  109.     BOOL m_bOnLastRecord;
  110.  
  111.     //{{AFX_MSG(CRecordView)
  112.     afx_msg void OnUpdateRecordFirst(CCmdUI* pCmdUI);
  113.     afx_msg void OnUpdateRecordPrev(CCmdUI* pCmdUI);
  114.     afx_msg void OnUpdateRecordNext(CCmdUI* pCmdUI);
  115.     afx_msg void OnUpdateRecordLast(CCmdUI* pCmdUI);
  116.     //}}AFX_MSG
  117.  
  118.     DECLARE_MESSAGE_MAP()
  119. };
  120.  
  121. /////////////////////////////////////////////////////////////////////////////
  122.  
  123. #ifdef _AFX_PACKING
  124. #pragma pack(pop)
  125. #endif
  126.  
  127. #undef AFX_DATA
  128. #define AFX_DATA
  129.  
  130. #ifdef _AFX_MINREBUILD
  131. #pragma component(minrebuild, on)
  132. #endif
  133. #ifndef _AFX_FULLTYPEINFO
  134. #pragma component(mintypeinfo, off)
  135. #endif
  136.  
  137. #endif __AFXOLEDB_H__
  138.