home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / source / chap18 / doserver / doserver.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-14  |  3.1 KB  |  119 lines

  1. // DoServerView.cpp : implementation of the CDoServerView class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "DoServer.h"
  6.  
  7. #include "DoServerDoc.h"
  8. #include "DoServerView.h"
  9.  
  10. #ifdef _DEBUG
  11. #define new DEBUG_NEW
  12. #undef THIS_FILE
  13. static char THIS_FILE[] = __FILE__;
  14. #endif
  15.  
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CDoServerView
  18.  
  19. IMPLEMENT_DYNCREATE(CDoServerView, CView)
  20.  
  21. BEGIN_MESSAGE_MAP(CDoServerView, CView)
  22.     //{{AFX_MSG_MAP(CDoServerView)
  23.         // NOTE - the ClassWizard will add and remove mapping macros here.
  24.         //    DO NOT EDIT what you see in these blocks of generated code!
  25.     ON_COMMAND(ID_CANCEL_EDIT_SRVR, OnCancelEditSrvr)
  26.     //}}AFX_MSG_MAP
  27.     // Standard printing commands
  28.     ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
  29.     ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
  30.     ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
  31. END_MESSAGE_MAP()
  32.  
  33. /////////////////////////////////////////////////////////////////////////////
  34. // CDoServerView construction/destruction
  35.  
  36. CDoServerView::CDoServerView()
  37. {
  38.     // TODO: add construction code here
  39.  
  40. }
  41.  
  42. CDoServerView::~CDoServerView()
  43. {
  44. }
  45.  
  46. BOOL CDoServerView::PreCreateWindow(CREATESTRUCT& cs)
  47. {
  48.     // TODO: Modify the Window class or styles here by modifying
  49.     //  the CREATESTRUCT cs
  50.  
  51.     return CView::PreCreateWindow(cs);
  52. }
  53.  
  54. /////////////////////////////////////////////////////////////////////////////
  55. // CDoServerView drawing
  56.  
  57. void CDoServerView::OnDraw(CDC* pDC)
  58. {
  59.     CDoServerDoc* pDoc = GetDocument();
  60.     ASSERT_VALID(pDoc);
  61.  
  62.     // TODO: add draw code for native data here
  63.     pDoc->Draw(pDC);                                    // OLE server addition
  64. }
  65.  
  66. /////////////////////////////////////////////////////////////////////////////
  67. // CDoServerView printing
  68.  
  69. BOOL CDoServerView::OnPreparePrinting(CPrintInfo* pInfo)
  70. {
  71.     // default preparation
  72.     return DoPreparePrinting(pInfo);
  73. }
  74.  
  75. void CDoServerView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  76. {
  77.     // TODO: add extra initialization before printing
  78. }
  79.  
  80. void CDoServerView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  81. {
  82.     // TODO: add cleanup after printing
  83. }
  84.  
  85. /////////////////////////////////////////////////////////////////////////////
  86. // OLE Server support
  87.  
  88. // The following command handler provides the standard keyboard
  89. //  user interface to cancel an in-place editing session.  Here,
  90. //  the server (not the container) causes the deactivation.
  91. void CDoServerView::OnCancelEditSrvr()
  92. {
  93.     GetDocument()->OnDeactivateUI(FALSE);
  94. }
  95.  
  96. /////////////////////////////////////////////////////////////////////////////
  97. // CDoServerView diagnostics
  98.  
  99. #ifdef _DEBUG
  100. void CDoServerView::AssertValid() const
  101. {
  102.     CView::AssertValid();
  103. }
  104.  
  105. void CDoServerView::Dump(CDumpContext& dc) const
  106. {
  107.     CView::Dump(dc);
  108. }
  109.  
  110. CDoServerDoc* CDoServerView::GetDocument() // non-debug version is inline
  111. {
  112.     ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDoServerDoc)));
  113.     return (CDoServerDoc*)m_pDocument;
  114. }
  115. #endif //_DEBUG
  116.  
  117. /////////////////////////////////////////////////////////////////////////////
  118. // CDoServerView message handlers
  119.