mteatherdlg.cpp

来自「燕山大学监考系统」· C++ 代码 · 共 68 行

CPP
68
字号
// MTeatherDlg.cpp : implementation file
//

#include "stdafx.h"
#include "M_ESystem.h"
#include "MTeatherDlg.h"
#include "M_ESystemDoc.h"
#include "M_ESystemView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMTeatherDlg dialog


CMTeatherDlg::CMTeatherDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CMTeatherDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CMTeatherDlg)
	m_M_teacher = _T("");
	//}}AFX_DATA_INIT
}


void CMTeatherDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CMTeatherDlg)
	DDX_Text(pDX, IDC_EDIT1, m_M_teacher);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CMTeatherDlg, CDialog)
	//{{AFX_MSG_MAP(CMTeatherDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMTeatherDlg message handlers

void CMTeatherDlg::OnOK() 
{
	// TODO: Add extra validation here
	static int nCount1=0;
	CDialog::OnOK();
	//UpdateData(TRUE);
	CM_ESystemDoc* pDoc = (CM_ESystemDoc*)this->GetParentFrame()->GetActiveDocument();
	CM_ESystemView* pView = (CM_ESystemView*)this->GetParentFrame()->GetActiveView();
	if(m_M_teacher.IsEmpty())
	{
		MessageBox("您没有输入老师姓名");
	}
	else 
	{
	UpdateData(TRUE);
	pDoc->m_mTeacher[nCount1] = m_M_teacher;
	nCount1++;
	}
    pDoc->count2=nCount1;
	
    //MessageBox(pDoc->count2);
}

⌨️ 快捷键说明

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