【VC开源代码栏目提醒】:网学会员为需要VC开源代码的朋友们搜集整理了CEx13_01ActiveXAppView.cpp相关资料,希望对各位网友有所帮助!
// CEx13_01ActiveXAppView.cpp : implementation of the CCEx13_01ActiveXAppView class
//
#include "stdafx.h"
#include "CEx13_01ActiveXApp.h"
#include "CEx13_01ActiveXAppDoc.h"
#include "CEx13_01ActiveXAppView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCEx13_01ActiveXAppView
IMPLEMENT_DYNCREATE(CCEx13_01ActiveXAppView, CFormView)
BEGIN_MESSAGE_MAP(CCEx13_01ActiveXAppView, CFormView)
//{{AFX_MSG_MAP(CCEx13_01ActiveXAppView)
ON_BN_CLICKED(IDC_SET_CLOCK, OnSetClock)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CFormView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CFormView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CFormView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCEx13_01ActiveXAppView construction/destruction
CCEx13_01ActiveXAppView::CCEx13_01ActiveXAppView()
: CFormView(CCEx13_01ActiveXAppView::IDD)
{
//{{AFX_DATA_INIT(CCEx13_01ActiveXAppView)
m_sethour = 0;
m_setmin = 0;
m_setsec = 0;
//}}AFX_DATA_INIT
// TODO: add construction code here
}
CCEx13_01ActiveXAppView::~CCEx13_01ActiveXAppView()
{
}
void CCEx13_01ActiveXAppView::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCEx13_01ActiveXAppView)
DDX_Text(pDX, IDC_HOUR, m_sethour);
DDX_Text(pDX, IDC_MIN, m_setmin);
DDX_Text(pDX, IDC_SEC, m_setsec);
DDX_Control(pDX, IDC_ACTIVEX, m_ctrlClock);
//}}AFX_DATA_MAP
}
BOOL CCEx13_01ActiveXAppView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CFormView::PreCreateWindow(cs);
}
void CCEx13_01ActiveXAppView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();
}
/////////////////////////////////////////////////////////////////////////////
// CCEx13_01ActiveXAppView printing
BOOL CCEx13_01ActiveXAppView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CCEx13_01ActiveXAppView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CCEx13_01ActiveXAppView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
void CCEx13_01ActiveXAppView::OnPrint(CDC* pDC, CPrintInfo* /*pInfo*/)
{
// TODO: add customized printing code here
}
/////////////////////////////////////////////////////////////////////////////
// CCEx13_01ActiveXAppView diagnostics
#ifdef _DEBUG
void CCEx13_01ActiveXAppView::AssertValid() const
{
CFormView::AssertValid();
}
void CCEx13_01ActiveXAppView::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
CCEx13_01ActiveXAppDoc* CCEx13_01ActiveXAppView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCEx13_01ActiveXAppDoc)));
return (CCEx13_01ActiveXAppDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CCEx13_01ActiveXAppView message handlers
BEGIN_EVENTSINK_MAP(CCEx13_01ActiveXAppView, CFormView)
//{{AFX_EVENTSINK_MAP(CCEx13_01ActiveXAppView)
ON_EVENT(CCEx13_01ActiveXAppView, IDC_ACTIVEX, 1 /* IsTime */, OnIsTimeActivex, VTS_NONE)
//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()
void CCEx13_01ActiveXAppView::OnIsTimeActivex()
{
// TODO: Add your control notification handler code here
// for(int i = 0; i < 1000; i++)
MessageBeep((WORD) - 1);
}
void CCEx13_01ActiveXAppView::OnSetClock()
{
// TODO: Add your control notification handler code here
UpdateData(true);
m_ctrlClock.SetTime(m_sethour, m_setmin, m_setsec);
}
上一篇:
CEx13_01ActiveXAppDoc.cpp
下一篇:
ASP小区停车管理系统(Access)(含录像)