⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex09aview.cpp

📁 vc.net内幕系列源码
💻 CPP
字号:
// Ex09aView.cpp : implementation of the CEx09aView class
//

#include "stdafx.h"
#include "Ex09a.h"
#include "ActiveXDialog.h"

#include "Ex09aDoc.h"
#include "Ex09aView.h"


#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CEx09aView

IMPLEMENT_DYNCREATE(CEx09aView, CView)

BEGIN_MESSAGE_MAP(CEx09aView, CView)
	ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()

// CEx09aView construction/destruction

CEx09aView::CEx09aView()
{
	// TODO: add construction code here

}

CEx09aView::~CEx09aView()
{
}

BOOL CEx09aView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

// CEx09aView drawing

void CEx09aView::OnDraw(CDC* pDC)
{
	pDC->TextOut(0, 0, "Press the left mouse button here.");
}


// CEx09aView diagnostics

#ifdef _DEBUG
void CEx09aView::AssertValid() const
{
	CView::AssertValid();
}

void CEx09aView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CEx09aDoc* CEx09aView::GetDocument() const // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEx09aDoc)));
	return (CEx09aDoc*)m_pDocument;
}
#endif //_DEBUG


// CEx09aView message handlers

void CEx09aView::OnLButtonDown(UINT nFlags, CPoint point)
{
	CActiveXDialog dlg;
    dlg.m_BackColor = RGB(255, 251, 240); // light yellow
    COleDateTime today = COleDateTime::GetCurrentTime();
    dlg.m_varValue = COleDateTime(today.GetYear(), today.GetMonth(),
                                  today.GetDay(), 0, 0, 0);
    if (dlg.DoModal() == IDOK) {
        COleDateTime date(dlg.m_varValue);
        AfxMessageBox(date.Format("%B %d, %Y"));

	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -