home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 39 / IOPROG_39.ISO / SOFT / sdkjava40.exe / data1.cab / fg_Samples / Samples / Profiler / heapmon / baseview.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-04  |  1.8 KB  |  87 lines

  1. // baseview.hpp
  2. //
  3. // Created 10/07/98
  4. //
  5. // (C)Copyright 1998-1999 Microsoft Corporation, All rights reserved.
  6. //
  7.  
  8. #ifndef __BASEVIEW_HPP__
  9. #define __BASEVIEW_HPP__
  10.  
  11. #include "hpmnclnt.hpp"
  12. #include "guids.h"
  13.  
  14. class HeapMonitorManager;
  15.  
  16.  
  17. enum BasicClientWindowMessages
  18. {
  19.     WM_BC_FIRST = WM_USER,
  20.  
  21.     WM_BC_DESTROY_NOW = WM_BC_FIRST,
  22.  
  23.     WM_BC_LAST,
  24. };
  25.  
  26.  
  27. class BasicClient : public IHeapMonitorClient
  28. {
  29. private:
  30.  
  31.     ULONG m_RefCount;
  32.  
  33. protected:
  34.  
  35.     HeapMonitorManager *m_mgr;
  36.  
  37.     HWND m_hwnd;
  38.  
  39.  
  40.     //------------------------------------------------------------------------
  41.     // UI stuff
  42.  
  43.     static LRESULT CALLBACK BaseWndProc (HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam);
  44.  
  45.     virtual BOOL OnCreateWindow () = 0;
  46.  
  47.     
  48.     //------------------------------------------------------------------------
  49.  
  50.     BasicClient ();
  51.     virtual ~BasicClient ();
  52.  
  53.     // Creates a MDI client window
  54.     BOOL BasePreInitialize (HeapMonitorManager *mgr, PCSTR wndclsname, PCSTR wndtitle);
  55.     BOOL BasePostInitialize (HeapMonitorClientRegistrationInfo *preginfo);
  56.  
  57.     BOOL BaseInitialize (HeapMonitorManager *mgr, PCSTR wndclsname, PCSTR wndtitle, HeapMonitorClientRegistrationInfo *preginfo)
  58.     {
  59.         return    BasePreInitialize(mgr, wndclsname, wndtitle)
  60.                && BasePostInitialize(preginfo);
  61.     }
  62.  
  63.  
  64.     //------------------------------------------------------------------------
  65.  
  66. public:
  67.  
  68.     // IUnknown methods
  69.  
  70.     ULONG STDMETHODCALLTYPE AddRef (VOID);
  71.     ULONG STDMETHODCALLTYPE Release (VOID);
  72.     STDMETHODIMP QueryInterface (REFIID riid, PVOID *ppvObj);
  73.  
  74.     // IHeapMonitorClient methods
  75.  
  76.     STDMETHODIMP OnClose ()
  77.     {
  78.         SendMessage(m_hwnd, WM_CLOSE, 0, 0);
  79.         return S_OK;
  80.     }
  81. };
  82.  
  83.  
  84.  
  85. #endif /* __BASEVIEW_HPP__ */
  86.  
  87.