基于对话框的MFC程序,在线等大侠!!
程序调试最后两个错误,不知如何解决??
其中的一个类的源文件:
// UserEditDlg.cpp : implementation file
//
#include "stdafx.h"
#include "HospitalMan.h"
#include "UserEditDlg.h"
#include "Users.h"
extern CUsers curUser;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CUserEditDlg dialog
CUserEditDlg::CUserEditDlg(CWnd* pParent /*=NULL*/)
: CDialog(CUserEditDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CUserEditDlg)
m_UserName = _T("");
m_UserType = _T("");
//}}AFX_DATA_INIT
}
void CUserEditDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CUserEditDlg)
DDX_Text(pDX, IDC_USERNAME_EDIT, m_UserName);
DDX_CBString(pDX, IDC_USERTYPE_COMBO, m_UserType);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CUserEditDlg, CDialog)
//{{AFX_MSG_MAP(CUserEditDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CUserEditDlg message handlers
BOOL CUserEditDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_UserType.SetCurSel(iUserType - 1);//指向这里
if (curUser.GetUserName() != "Admin")
GetDlgItem(IDC_USERTYPE_COMBO)->EnableWindow(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CUserEditDlg::OnOK()
{
// TODO: Add extra validation here
UpdateData(TRUE);
CUsers usr;
usr.SetUserName(m_UserName);
usr.SetPwd("888888");
usr.SetUser_type(m_UserType.GetCurSel()+1);//指向这里
if (usr.HaveName(m_UserName) == 1) //如果存在当前用户
{
MessageBox("当前用户已存在,请选择其他用户名");
return;
}
//插入用户记录
usr.sql_insert();
CDialog::OnOK();
}
调试错误信息是:
--------------------Configuration: HospitalMan - Win32 Debug--------------------
Compiling...
UserEditDlg.cpp
F:\学习工具\VC++\MSDev98\MyProjects\HospitalMan\UserEditDlg.cpp(54) : error C2039: 'SetCurSel' : is not a member of 'CString'
f:\学习工具\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
F:\学习工具\VC++\MSDev98\MyProjects\HospitalMan\UserEditDlg.cpp(71) : error C2039: 'GetCurSel' : is not a member of 'CString'
f:\学习工具\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
Error executing cl.exe.
HospitalMan.exe - 2 error(s), 0 warning(s)