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

📄 dormitory.cpp

📁 学生住宿管理系统 本程序用于交流方面,仅共学习交流,用于其他方面 功能欠缺
💻 CPP
字号:
// Dormitory.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "Dormitory.h"
#include "DormitoryDlg.h"
#include "floor.h"
#include "Dorsystem.h"
#include "FileIO.h"
#include "objectset.h"
#include "student.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDormitoryApp

BEGIN_MESSAGE_MAP(CDormitoryApp, CWinApp)
	//{{AFX_MSG_MAP(CDormitoryApp)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG
	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDormitoryApp construction

CDormitoryApp::CDormitoryApp()
{
	// TODO: add construction code here,
	// Place all significant initialization in InitInstance
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CDormitoryApp object

CDormitoryApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CDormitoryApp initialization

BOOL CDormitoryApp::InitInstance()
{
	AfxEnableControlContainer();

	// Standard initialization
	// If you are not using these features and wish to reduce the size
	//  of your final executable, you should remove from the following
	//  the specific initialization routines you do not need.

#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif
/*
	Cstudent*st1;
	st1=new Cstudent();
	vec2=new Cobjectset();
	st1->no="S200407031";
	st1->name="lixue";
	st1->dept="jisuanji";
	st1->grade="ji001";
	st1->sex="女";
	vec2->AddRecord(st1);

    
    Cstudent*st2;
	st2=new Cstudent();
	st2->no="S200407032";
	st2->name="大寄生";
	st2->dept="jisuanji";
	st2->grade="ji001";
	st2->sex="男";
	vec2->AddRecord(st2);

    Cstudent*st8;
	st8=new Cstudent();
	st8->no="S200407099";
	st8->name="改变";
	st8->dept="jisuanji";
	st8->grade="ji001";
	st8->sex="女";
	vec2->AddRecord(st8);

    Cstudent*st3;
	st3=new Cstudent();
	st3->no="S200405066";
	st3->name="风格法";
	st3->dept="经济管理";
	st3->grade="经管001";
	st3->sex="女";
	vec2->AddRecord(st3);

    Cstudent*st4;
	st4=new Cstudent();
	st4->no="S200405011";
	st4->name="而";
	st4->dept="经济管理";
	st4->grade="经管001";
	st4->sex="男";
	vec2->AddRecord(st4);

    Cstudent*st5;
	st5=new Cstudent();
	st5->no="S200405037";
	st5->name="似的";
	st5->dept="经济管理";
	st5->grade="经管001";
	st5->sex="女";
	vec2->AddRecord(st5);


    Cstudent*st6;
	st6=new Cstudent();
	st6->no="S200407034";
	st6->name="反对感";
	st6->dept="jisuanji";
	st6->grade="ji001";
	st6->sex="男";
	vec2->AddRecord(st6);

    Cstudent*st7;
	st7=new Cstudent();
	st7->no="S200407088";
	st7->name="如同以后";
	st7->dept="jisuanji";
	st7->grade="ji001";
	st7->sex="女";
	vec2->AddRecord(st7);

    vec2=new Cobjectset();
	fio.SaveObjectSet((CString)"mystudent.vec",vec2);
    fio.SaveObjectSet((CString)"my.vec",vec2);//向文件中写楼的基本信息
	fio.SaveObjectSet((CString)"mysturoom.vec",vec2);//向文件中写分配的基本信息
*/
		
	vec2=new Cobjectset();
    fio.LoadObjectSet((CString)"my.vec",&dm.vec1);//从文件中读宿舍对象信息的集合,放在vec1中
	fio.LoadObjectSet((CString)"mystudent.vec",vec2);//从文件中读学生对象信息,放在vec2中
	fio.LoadObjectSet((CString)"mysturoom.vec",&dm.vec3);//从文件中读宿舍分配对象信息,放在vec3中

	CDormitoryDlg dlg;
	m_pMainWnd = &dlg;
	int nResponse = dlg.DoModal();//弹出主窗体
	if (nResponse == IDOK)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with OK
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with Cancel
	}
	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}

⌨️ 快捷键说明

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