home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / com / dcom / atldraw / atldview.h < prev    next >
C/C++ Source or Header  |  1998-04-02  |  3KB  |  95 lines

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