?? dormitory.cpp
字號(hào):
// 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="風(fēng)格法";
st3->dept="經(jīng)濟(jì)管理";
st3->grade="經(jīng)管001";
st3->sex="女";
vec2->AddRecord(st3);
Cstudent*st4;
st4=new Cstudent();
st4->no="S200405011";
st4->name="而";
st4->dept="經(jīng)濟(jì)管理";
st4->grade="經(jīng)管001";
st4->sex="男";
vec2->AddRecord(st4);
Cstudent*st5;
st5=new Cstudent();
st5->no="S200405037";
st5->name="似的";
st5->dept="經(jīng)濟(jì)管理";
st5->grade="經(jīng)管001";
st5->sex="女";
vec2->AddRecord(st5);
Cstudent*st6;
st6=new Cstudent();
st6->no="S200407034";
st6->name="反對(duì)感";
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);//從文件中讀宿舍對(duì)象信息的集合,放在vec1中
fio.LoadObjectSet((CString)"mystudent.vec",vec2);//從文件中讀學(xué)生對(duì)象信息,放在vec2中
fio.LoadObjectSet((CString)"mysturoom.vec",&dm.vec3);//從文件中讀宿舍分配對(duì)象信息,放在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;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -