VisualC++课程设计报告

  • 格式:doc
  • 大小:341.50 KB
  • 文档页数:10

Visual C++课程设计报告

1.软件名称:职员信息输入程序

2.软件功能:

输入一个人的职业,工作地点,兴趣爱好以及薪资,然后显示。

3.编码实施

// Prop2.cpp : implementation file

//

#include "stdafx.h"

#include "Prop.h"

#include "Prop2.h"

#ifdef _DEBUG

#define new DEBUG_NEW

#undef THIS_FILE

static char THIS_FILE[] = __FILE__;

#endif

/////////////////////////////////////////////////////////////////////////////

// CProp2 property page

IMPLEMENT_DYNCREATE(CProp2, CPropertyPage)

CProp2::CProp2() : CPropertyPage(CProp2::IDD)

{

//{{AFX_DATA_INIT(CProp2)

m_football = FALSE;

m_basketball = FALSE;

m_volleyball = FALSE;

m_swim = FALSE;

//}}AFX_DATA_INIT

}

CProp2::~CProp2()

{

}

void CProp2::DoDataExchange(CDataExchange* pDX)

{

CPropertyPage::DoDataExchange(pDX);

//{{AFX_DATA_MAP(CProp2)

DDX_Check(pDX, IDC_CHECK1, m_football);

DDX_Check(pDX, IDC_CHECK2, m_basketball);

DDX_Check(pDX, IDC_CHECK3, m_volleyball);

DDX_Check(pDX, IDC_CHECK4, m_swim);

//}}AFX_DATA_MAP

}

BEGIN_MESSAGE_MAP(CProp2, CPropertyPage)

//{{AFX_MSG_MAP(CProp2)

//}}AFX_MSG_MAP

END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////

// CProp2 message handlers

BOOL CProp2::OnSetActive()

{

// TODO: Add your specialized code here and/or call the base class

((CPropertySheet*)GetParent())->SetWizardButtons(PSWIZB_BACK | PSWIZB_NEXT);

return CPropertyPage::OnSetActive();

}

//DEL BOOL CProp2::OnInitDialog()

//DEL {

//DEL CPropertyPage::OnInitDialog();

//DEL

//DEL // TODO: Add extra initialization here

//DEL ((CListBox*)GetDlgItem(IDC_LIST1))->AddString("北京");

//DEL ((CListBox*)GetDlgItem(IDC_LIST1))->AddString("天津");

//DEL ((CListBox*)GetDlgItem(IDC_LIST1))->AddString("上海");

//DEL return TRUE; // return TRUE unless you set the focus to a control

//DEL // EXCEPTION: OCX Property Pages should return FALSE

//DEL }

LRESULT CProp2::OnWizardNext()

{

// TODO: Add your specialized code here and/or call the base class

UpdateData();

if( m_football || m_basketball || m_volleyball || m_swim) return CPropertyPage::OnWizardNext();

else

{

MessageBox("请选择你的兴趣爱好!");

return -1;

}

}

#if !defined(AFX_PROP1_H__978F2F2C_DDCA_4EF6_AB94_94508ED6470B__INCLUDED_)

#define AFX_PROP1_H__978F2F2C_DDCA_4EF6_AB94_94508ED6470B__INCLUDED_

#if _MSC_VER > 1000

#pragma once

#endif // _MSC_VER > 1000

// Prop1.h : header file

//

/////////////////////////////////////////////////////////////////////////////

// CProp1 dialog

class CProp1 : public CPropertyPage

{

DECLARE_DYNCREATE(CProp1)

// Construction

public:

CProp1();

~CProp1();

// Dialog Data

//{{AFX_DATA(CProp1)

enum { IDD = IDD_PROP1 };

int m_occupation;

CString m_workAddr;

//}}AFX_DATA

// Overrides

// ClassWizard generate virtual function overrides

//{{AFX_VIRTUAL(CProp1)

public:

virtual BOOL OnSetActive();

virtual LRESULT OnWizardNext();

protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support

//}}AFX_VIRTUAL

// Implementation

protected:

// Generated message map functions

//{{AFX_MSG(CProp1)

virtual BOOL OnInitDialog();

//}}AFX_MSG

DECLARE_MESSAGE_MAP()

};

//{{AFX_INSERT_LOCATION}}

// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif

// !defined(AFX_PROP1_H__978F2F2C_DDCA_4EF6_AB94_94508ED6470B__INCLUDED_)

#if !defined(AFX_PROP1_H__978F2F2C_DDCA_4EF6_AB94_94508ED6470B__INCLUDED_)

#define AFX_PROP1_H__978F2F2C_DDCA_4EF6_AB94_94508ED6470B__INCLUDED_

#if _MSC_VER > 1000

#pragma once

#endif // _MSC_VER > 1000

// Prop1.h : header file

//

/////////////////////////////////////////////////////////////////////////////

// CProp1 dialog

class CProp1 : public CPropertyPage

{

DECLARE_DYNCREATE(CProp1)

// Construction

public:

CProp1();

~CProp1();

// Dialog Data

//{{AFX_DATA(CProp1)

enum { IDD = IDD_PROP1 };

int m_occupation;