ex121View.cpp
资源名称:VC6.0.rar [点击查看]
上传用户:qdhmjx
上传日期:2022-07-11
资源大小:2226k
文件大小:3k
源码类别:
书籍源码
开发平台:
Visual C++
- // ex121View.cpp : implementation of the CEx121View class
- //
- #include "stdafx.h"
- #include "ex121.h"
- #include "ex121Doc.h"
- #include "ex121View.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CEx121View
- IMPLEMENT_DYNCREATE(CEx121View, CView)
- BEGIN_MESSAGE_MAP(CEx121View, CView)
- //{{AFX_MSG_MAP(CEx121View)
- ON_WM_LBUTTONDOWN()
- ON_WM_RBUTTONDOWN()
- //}}AFX_MSG_MAP
- // Standard printing commands
- ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
- ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
- ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CEx121View construction/destruction
- CEx121View::CEx121View()
- {
- // TODO: add construction code here
- }
- CEx121View::~CEx121View()
- {
- }
- BOOL CEx121View::PreCreateWindow(CREATESTRUCT& cs)
- {
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
- return CView::PreCreateWindow(cs);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CEx121View drawing
- void CEx121View::OnDraw(CDC* pDC)
- {
- CEx121Doc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
- // TODO: add draw code for native data here
- }
- /////////////////////////////////////////////////////////////////////////////
- // CEx121View printing
- BOOL CEx121View::OnPreparePrinting(CPrintInfo* pInfo)
- {
- // default preparation
- return DoPreparePrinting(pInfo);
- }
- void CEx121View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add extra initialization before printing
- }
- void CEx121View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add cleanup after printing
- }
- /////////////////////////////////////////////////////////////////////////////
- // CEx121View diagnostics
- #ifdef _DEBUG
- void CEx121View::AssertValid() const
- {
- CView::AssertValid();
- }
- void CEx121View::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
- CEx121Doc* CEx121View::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEx121Doc)));
- return (CEx121Doc*)m_pDocument;
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CEx121View message handlers
- void CEx121View::OnLButtonDown(UINT nFlags, CPoint point)
- {
- sndPlaySound("start.wav",SND_ASYNC);//开始播放声音
- CView::OnLButtonDown(nFlags, point);
- }
- void CEx121View::OnRButtonDown(UINT nFlags, CPoint point)
- {
- sndPlaySound(NULL,0);//停止播放
- CView::OnRButtonDown(nFlags, point);
- }
English
