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

📄 selectview.cpp

📁 一个随即抽签程序
💻 CPP
字号:
// SelectView.cpp : implementation of the CSelectView class
//

#include "stdafx.h"
#include "Select.h"

#include "SelectDoc.h"
#include "SelectView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSelectView

IMPLEMENT_DYNCREATE(CSelectView, CView)

BEGIN_MESSAGE_MAP(CSelectView, CView)
	//{{AFX_MSG_MAP(CSelectView)
	ON_COMMAND(IDM_WRITE, OnWrite)
	//}}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()

/////////////////////////////////////////////////////////////////////////////
// CSelectView construction/destruction

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

}

CSelectView::~CSelectView()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CSelectView drawing

void CSelectView::OnDraw(CDC* pDC)
{
	CSelectDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CSelectView printing

BOOL CSelectView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CSelectView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CSelectView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CSelectView diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CSelectView message handlers

void CSelectView::OnWrite() 
{
	// TODO: Add your command handler code here
	 FILE *pFile=fopen("1.txt","w");
	 char buf[22]="http//www.sunxin.org";
	 buf[21]='\0';
	 fwrite(buf,1,22,pFile);
	 fclose(pFile);
	
}

⌨️ 快捷键说明

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