home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / atl / dcom / atldraw / atldview.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  3.0 KB  |  96 lines

  1. // ATLDrawView.h : interface of the CATLDrawView class
  2. //
  3. // This is a part of the Active Template Library.
  4. // Copyright (C) 1996-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Active Template Library Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Active Template Library product.
  12. //
  13. /////////////////////////////////////////////////////////////////////////////
  14. #include "..\DrawServ\DrawServ.h"
  15.  
  16. class CATLDrawView : public CView
  17. {
  18. protected: // create from serialization only
  19.     CATLDrawView();
  20.     DECLARE_DYNCREATE(CATLDrawView)
  21.  
  22. // Attributes
  23. public:
  24.     CATLDrawDoc* GetDocument();
  25.  
  26. // Operations
  27. public:
  28.  
  29. // Overrides
  30.     // ClassWizard generated virtual function overrides
  31.     //{{AFX_VIRTUAL(CATLDrawView)
  32.     public:
  33.     virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  34.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  35.     protected:
  36.     virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  37.     virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  38.     virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
  39.     //}}AFX_VIRTUAL
  40.  
  41. // Implementation
  42. public:
  43.     virtual ~CATLDrawView();
  44. #ifdef _DEBUG
  45.     virtual void AssertValid() const;
  46.     virtual void Dump(CDumpContext& dc) const;
  47. #endif
  48.     BOOL    ConnectSink(REFIID iid, LPUNKNOWN punkSink);
  49.     void    DisconnectSink(REFIID iid, DWORD dwCookie);
  50.  
  51.  
  52. private:
  53.     IDrawServ*  m_pDrawServ;
  54.     BOOL        m_bDragging;
  55.     CPoint      m_pos;
  56.     COLORREF    m_col;
  57.     DWORD       m_dwDrawServ;
  58.  
  59. // Generated message map functions
  60. protected:
  61.     //{{AFX_MSG(CATLDrawView)
  62.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  63.     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  64.     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  65.     afx_msg void OnServerConnect();
  66.     afx_msg void OnServerDisconnent();
  67.     afx_msg void OnUpdateServerConnect(CCmdUI* pCmdUI);
  68.     afx_msg void OnUpdateServerDisconnent(CCmdUI* pCmdUI);
  69.     afx_msg void OnViewColor();
  70.     //}}AFX_MSG
  71.     DECLARE_MESSAGE_MAP()
  72.     void    Draw(long x1, long y1, long x2, long y2, unsigned long col);
  73.  
  74.     BEGIN_INTERFACE_PART(DrawServ, IDrawServ)
  75.         STDMETHOD(GetTypeInfoCount)(unsigned int*)
  76.             { return E_NOTIMPL; }
  77.         STDMETHOD(GetTypeInfo)(unsigned int, LCID, ITypeInfo**)
  78.             { return E_NOTIMPL; }
  79.         STDMETHOD(GetIDsOfNames)(REFIID, LPOLESTR*, unsigned int, LCID, DISPID*)
  80.             { return E_NOTIMPL; }
  81.         STDMETHOD(Invoke)(DISPID, REFIID, LCID, unsigned short, DISPPARAMS*,
  82.                           VARIANT*, EXCEPINFO*, unsigned int*)
  83.             { return E_NOTIMPL; }
  84.         STDMETHOD(Draw)(long x1, long y1, long x2, long y2, unsigned long col);
  85.     END_INTERFACE_PART(DrawServ)
  86.  
  87.     DECLARE_INTERFACE_MAP()
  88. };
  89.  
  90. #ifndef _DEBUG  // debug version in ATLDrawView.cpp
  91. inline CATLDrawDoc* CATLDrawView::GetDocument()
  92.    { return (CATLDrawDoc*)m_pDocument; }
  93. #endif
  94.  
  95. /////////////////////////////////////////////////////////////////////////////
  96.