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

  1. //+---------------------------------------------------------------------------
  2. //
  3. //  Microsoft Windows
  4. //  Copyright 1992 - 1997 Microsoft Corporation.
  5. //
  6. //  File:       cdialog.h
  7. //
  8. //  Contents:   definition for common dialog functionality
  9. //
  10. //  Classes:    CHlprDialog (pure virtual class)
  11. //
  12. //  Functions:  DialogProc
  13. //
  14. //  History:    4-12-94   stevebl   Created
  15. //
  16. //----------------------------------------------------------------------------
  17.  
  18. #ifndef __CDIALOG_H__
  19. #define __CDIALOG_H__
  20.  
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24.  
  25. BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  26.  
  27. #ifdef __cplusplus
  28. }
  29.  
  30. //+---------------------------------------------------------------------------
  31. //
  32. //  Class:      CHlprDialog
  33. //
  34. //  Purpose:    virtual base class for wrapping Windows' dialog functionality
  35. //
  36. //  Interface:  ShowDialog -- analagous to the Windows DialogBox function
  37. //              DialogProc -- pure virtual DialogProc for the dialog box
  38. //              ~CHlprDialog   -- destructor
  39. //
  40. //  History:    4-12-94   stevebl   Created
  41. //
  42. //  Notes:      This class allows a dialog box to be cleanly wrapped in
  43. //              a c++ class.  Specifically, it provides a way for a c++ class
  44. //              to use one of its methods as a DialogProc, giving it a "this"
  45. //              pointer and allowing it to have direct access to all of its
  46. //              private members.
  47. //
  48. //----------------------------------------------------------------------------
  49.  
  50. class CHlprDialog
  51. {
  52. public:
  53.     virtual int ShowDialog(HINSTANCE hinst, LPCTSTR lpszTemplate, HWND hwndOwner);
  54.     virtual BOOL DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) = 0;
  55.     virtual ~CHlprDialog(){};
  56. protected:
  57.     HINSTANCE _hInstance;
  58. };
  59.  
  60. #endif //__cplusplus
  61.  
  62. #endif //__CDIALOG_H__
  63.  
  64.