home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / advanced / collect / mapdwvw.h < prev    next >
C/C++ Source or Header  |  1998-03-26  |  2KB  |  84 lines

  1. // mapdwvw.h : header file
  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. /////////////////////////////////////////////////////////////////////////////
  14. // CMapDWordToMyStructView form view
  15.  
  16. #ifndef __AFXEXT_H__
  17. #include <afxext.h>
  18. #endif
  19.  
  20. class CMapDWordToMyStructView : public CFormView
  21. {
  22. public:
  23.     CMapDWordToMyStructView();           // protected constructor used by dynamic creation
  24.     DECLARE_DYNCREATE(CMapDWordToMyStructView)
  25.  
  26. // Form Data
  27. public:
  28.     //{{AFX_DATA(CMapDWordToMyStructView)
  29.     enum { IDD = IDD_MAP_DWORD_TO_MYSTRUCT };
  30.     CListBox    m_ctlList;
  31.     int     m_int;
  32.     float   m_float;
  33.     CString m_str;
  34.     DWORD   m_dwKey;
  35.     //}}AFX_DATA
  36.  
  37. // Attributes
  38. public:
  39.     CCollectDoc* GetDocument();
  40.  
  41. // Overrides
  42. public:
  43.     void OnInitialUpdate();
  44.  
  45. // Overrides
  46.     // ClassWizard generate virtual function overrides
  47.     //{{AFX_VIRTUAL(CMapDWordToMyStructView)
  48.     protected:
  49.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  50.     //}}AFX_VIRTUAL
  51.  
  52. // Implementation
  53. protected:
  54.     static CString FormatListBoxEntry(DWORD dwKey, CMyStruct* pMyStruct);
  55.     int FindKeyInListBox(DWORD dwKey);
  56.     void AddMapEntryToListBox(DWORD dwKey, CMyStruct* pMyStruct);
  57.     CMyStruct* ConstructMyStructFromView();
  58.     void UpdateViewFromMyStruct(CMyStruct* pMyStruct);
  59.  
  60. protected:
  61.     virtual ~CMapDWordToMyStructView();
  62. #ifdef _DEBUG
  63.     virtual void AssertValid() const;
  64.     virtual void Dump(CDumpContext& dc) const;
  65. #endif
  66.  
  67.     // Generated message map functions
  68.     //{{AFX_MSG(CMapDWordToMyStructView)
  69.     afx_msg void OnAddOrUpdate();
  70.     afx_msg void OnFind();
  71.     afx_msg void OnRemove();
  72.     afx_msg void OnRemoveAll();
  73.     afx_msg void OnSelChangeList();
  74.     //}}AFX_MSG
  75.     DECLARE_MESSAGE_MAP()
  76. };
  77.  
  78. #ifndef _DEBUG
  79. inline CCollectDoc* CMapDWordToMyStructView::GetDocument()
  80.    { return (CCollectDoc*)m_pDocument; }
  81. #endif
  82.  
  83. /////////////////////////////////////////////////////////////////////////////
  84.