Advertisement
Guest User

Untitled

a guest
May 26th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1.  
  2. // MFCApplication1View.cpp : implementation of the CMFCApplication1View class
  3. //
  4.  
  5. #include "stdafx.h"
  6. // SHARED_HANDLERS can be defined in an ATL project implementing preview, thumbnail
  7. // and search filter handlers and allows sharing of document code with that project.
  8. #ifndef SHARED_HANDLERS
  9. #include "MFCApplication1.h"
  10. #endif
  11.  
  12. #include "MFCApplication1Doc.h"
  13. #include "MFCApplication1View.h"
  14.  
  15. #ifdef _DEBUG
  16. #define new DEBUG_NEW
  17. #endif
  18.  
  19.  
  20. // CMFCApplication1View
  21.  
  22. IMPLEMENT_DYNCREATE(CMFCApplication1View, CView)
  23.  
  24. BEGIN_MESSAGE_MAP(CMFCApplication1View, CView)
  25. // Standard printing commands
  26. ON_COMMAND(ID_FILE_PRINT, &CView::OnFilePrint)
  27. ON_COMMAND(ID_FILE_PRINT_DIRECT, &CView::OnFilePrint)
  28. ON_COMMAND(ID_FILE_PRINT_PREVIEW, &CView::OnFilePrintPreview)
  29. END_MESSAGE_MAP()
  30.  
  31. // CMFCApplication1View construction/destruction
  32.  
  33. CMFCApplication1View::CMFCApplication1View()
  34. {
  35. // TODO: add construction code here
  36.  
  37. }
  38.  
  39. CMFCApplication1View::~CMFCApplication1View()
  40. {
  41. }
  42.  
  43. BOOL CMFCApplication1View::PreCreateWindow(CREATESTRUCT& cs)
  44. {
  45. // TODO: Modify the Window class or styles here by modifying
  46. // the CREATESTRUCT cs
  47.  
  48. return CView::PreCreateWindow(cs);
  49. }
  50.  
  51. // CMFCApplication1View drawing
  52.  
  53. void CMFCApplication1View::OnDraw(CDC* /*pDC*/)
  54. {
  55. CMFCApplication1Doc* pDoc = GetDocument();
  56. ASSERT_VALID(pDoc);
  57. if (!pDoc)
  58. return;
  59.  
  60. // TODO: add draw code for native data here
  61. }
  62.  
  63.  
  64. // CMFCApplication1View printing
  65.  
  66. BOOL CMFCApplication1View::OnPreparePrinting(CPrintInfo* pInfo)
  67. {
  68. // default preparation
  69. return DoPreparePrinting(pInfo);
  70. }
  71.  
  72. void CMFCApplication1View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  73. {
  74. // TODO: add extra initialization before printing
  75. }
  76.  
  77. void CMFCApplication1View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  78. {
  79. // TODO: add cleanup after printing
  80. }
  81.  
  82.  
  83. // CMFCApplication1View diagnostics
  84.  
  85. #ifdef _DEBUG
  86. void CMFCApplication1View::AssertValid() const
  87. {
  88. CView::AssertValid();
  89. }
  90.  
  91. void CMFCApplication1View::Dump(CDumpContext& dc) const
  92. {
  93. CView::Dump(dc);
  94. }
  95.  
  96. CMFCApplication1Doc* CMFCApplication1View::GetDocument() const // non-debug version is inline
  97. {
  98. ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMFCApplication1Doc)));
  99. return (CMFCApplication1Doc*)m_pDocument;
  100. }
  101. #endif //_DEBUG
  102.  
  103.  
  104. // CMFCApplication1View message handlers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement