www.pudn.com > win32.rar > TestDllView.cpp
// TestDllView.cpp : CTestDllView 类的实现
//
#include "stdafx.h"
#include "TestDll.h"
#include "TestDllDoc.h"
#include "TestDllView.h"
#include"MyDll.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CTestDllView
IMPLEMENT_DYNCREATE(CTestDllView, CView)
BEGIN_MESSAGE_MAP(CTestDllView, CView)
// 标准打印命令
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
ON_COMMAND(ID_TESTDLL, OnTestdll)
END_MESSAGE_MAP()
// CTestDllView 构造/销毁
CTestDllView::CTestDllView()
{
// TODO: 在此处添加构造代码
}
CTestDllView::~CTestDllView()
{
}
BOOL CTestDllView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: 在此处通过修改 CREATESTRUCT cs 来修改窗口类或
// 样式
return CView::PreCreateWindow(cs);
}
// CTestDllView 绘制
void CTestDllView::OnDraw(CDC* /*pDC*/)
{
CTestDllDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: 在此处为本机数据添加绘制代码
}
// CTestDllView 打印
BOOL CTestDllView::OnPreparePrinting(CPrintInfo* pInfo)
{
// 默认准备
return DoPreparePrinting(pInfo);
}
void CTestDllView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: 打印前添加额外的初始化
}
void CTestDllView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: 打印后添加清除过程
}
// CTestDllView 诊断
#ifdef _DEBUG
void CTestDllView::AssertValid() const
{
CView::AssertValid();
}
void CTestDllView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CTestDllDoc* CTestDllView::GetDocument() const // 非调试版本是内联的
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CTestDllDoc)));
return (CTestDllDoc*)m_pDocument;
}
#endif //_DEBUG
// CTestDllView 消息处理程序
void CTestDllView::OnTestdll()
{
// TODO: 在此添加命令处理程序代码
//调用动态链接库中的函数
Display();
}