【VC开源代码栏目提醒】:网学会员,鉴于大家对VC开源代码十分关注,论文会员在此为大家搜集整理了“GetSystemPathView.cpp”一文,供大家参考学习!
// GetSystemPathView.cpp : implementation of the CGetSystemPathView class
//
#include "stdafx.h"
#include "GetSystemPath.h"
#include "GetSystemPathDoc.h"
#include "GetSystemPathView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGetSystemPathView
IMPLEMENT_DYNCREATE(CGetSystemPathView, CView)
BEGIN_MESSAGE_MAP(CGetSystemPathView, CView)
//{{AFX_MSG_MAP(CGetSystemPathView)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CGetSystemPathView construction/destruction
CGetSystemPathView::CGetSystemPathView()
{
// TODO: add construction code here
}
CGetSystemPathView::~CGetSystemPathView()
{
}
BOOL CGetSystemPathView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CGetSystemPathView drawing
void CGetSystemPathView::OnDraw(CDC* pDC)
{
CGetSystemPathDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
char path[MAX_PATH] = {'\0'};
GetSystemDirectory(path,MAX_PATH);
CString syspath;
syspath.Format("系统安装目录为%s",path);
pDC->TextOut(10,10,syspath);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CGetSystemPathView printing
BOOL CGetSystemPathView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CGetSystemPathView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CGetSystemPathView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CGetSystemPathView diagnostics
#ifdef _DEBUG
void CGetSystemPathView::AssertValid() const
{
CView::AssertValid();
}
void CGetSystemPathView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CGetSystemPathDoc* CGetSystemPathView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CGetSystemPathDoc)));
return (CGetSystemPathDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CGetSystemPathView message handlers
上一篇:
GetSystemPathDoc.cpp
下一篇:
法律专业开题报告范文