程序又出问题了,不知怎么了
来源:互联网 发布:四会网络推广学校 编辑:程序博客网 时间:2024/06/10 12:41
// CityZoneDlg.cpp : implementation file
//
#include "stdafx.h"
#include "Ex_CityCode2.h"
#include "CityZoneDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCityZoneDlg dialog
CCityZoneDlg::CCityZoneDlg(CWnd* pParent /*=NULL*/)
: CDialog(CCityZoneDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CCityZoneDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CCityZoneDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCityZoneDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCityZoneDlg, CDialog)
//{{AFX_MSG_MAP(CCityZoneDlg)
ON_BN_CLICKED(IDC_BUTTON_ADD, OnButtonAdd)
ON_BN_CLICKED(IDC_BUTTON_CHANGE, OnButtonChange)
ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCityZoneDlg message handlers
BOOL CCityZoneDlg::IsValidate()
{
UpdateData();
m_strCity.TrimLeft();
if(m_strCity.IsEmpty())
{MessageBox("城市名输入无效!");return FALSE;
}
m_strZip.TrimLeft();
if(m_strZip.Isvalidate())
{MessageBox("邮政编码输入无效!");return FALSE;
}
m_strZone.TrimLeft();
if(m_strZone.Isvalidate())
{MessageBox("区号输入无效!");return FALSE;
}
return TRUE;
}
void CCityZoneDlg::OnButtonAdd()
{
// TODO: Add your control notification handler code here
if(!Isvalidate()) return;
int nIndex=m_ComboBox.FindStringExact(-1,m_strCity);
if(nIndex!=CB_ERR)
{MessageBox("该城市已添加!");return;}
CString strData;
strData.Format("%s,%s",m_strZip,m_strZone);
m_ComboBox.SetItemDataPtr(nIndex,new CString(strData));
}
void CCityZoneDlg::OnButtonChange()
{
// TODO: Add your control notification handler code here
if(!Isvalidate()) return;
int nIndex=m_ComboBox.FindStringExact(-1,m_strCity);
if(nIndex!=CB_ERR)
{delete(CString*)m_ComboBox.GetItemDataPtr(nIndex);
CString strData;
strData.Format("%s,%s",m_strZip,m_strZone);
m_ComboBox.SetItemDataPtr(nIndex,new CString(strData));
}
void CCityZoneDlg::OnSelchangeCombo1()
{
// TODO: Add your control notification handler code here
int nIndex=m_ComboBox.GetCurSel();
if(nIndex!=CB_ERR)
{m_ComboBox.GetLBText(nIndex,m_strCity);
CString strData=*(CString*)m_ComboBox.GetItemDataPtr(nIndex);
int n=strData.Find(',');
m_strZip=strData.Left(n);
m_strZone=strData.Mid(n+1);
UpdateData(FALSE);
}
}
void CCityZoneDlg::OnDestroy()
{
CDialog::OnDestroy();
// TODO: Add your message handler code here
for(int nIndex=m_ComboBox.GetCount()-1;nIndex>=0;nIndex)
delete(CString*)m_ComboBox.GetItemDataPtr(nIndex);
}
}
-------------------Configuration: Ex_CityCode2 - Win32 Debug--------------------
Compiling...
CityZoneDlg.cpp
D:\新建文件夹\Ex_CityCode2\CityZoneDlg.cpp(51) : error C2065: 'm_strCity' : undeclared identifier
D:\新建文件夹\Ex_CityCode2\CityZoneDlg.cpp(51) : error C2228: left of '.TrimLeft' must have class/struct/union type
D:\新建文件夹\Ex_CityCode2\CityZoneDlg.cpp(52) : error C2228: left of '.IsEmpty' must have class/struct/union type
D:\新建文件夹\Ex_CityCode2\CityZoneDlg.cpp(55) : error C2065: 'm_strZip' : undeclared identifier
D:\新建文件夹\Ex_CityCode2\CityZoneDlg.cpp(55) : error C2228: left of '.TrimLeft' must have class/struct/union type
D:\新建文件夹\Ex_CityCode2\CityZoneDlg.cpp(56) : error C2228: left of '.Isvalidate' must have class/struct/union type
D:\新建文件夹\Ex_CityCode2\CityZoneDlg.cpp(59) : error C2065: 'm_strZone' : undeclared identifier
D:\新建文件夹\Ex_CityCode2\CityZoneDlg.cpp(59) : error C2228: left of '.TrimLeft' must have class/struct/union type
D:\新建文件夹\Ex_CityCode2\CityZoneDlg.cpp(60) : error C2228: left of '.Isvalidate' must have class/struct/union type
D:\新建文件夹\Ex_CityCode2\CityZoneDlg.cpp(70) : error C2065: 'm_ComboBox' : undeclared identifier
D:\新建文件夹\Ex_CityCode2\CityZoneDlg.cpp(70) : error C2228: left of '.FindStringExact' must have class/struct/union type
D:\新建文件夹\Ex_CityCode2\CityZoneDlg.cpp(75) : error C2228: left of '.SetItemDataPtr' must have class/struct/union type
D:\新建文件夹\Ex_CityCode2\CityZoneDlg.cpp(82) : error C2228: left of '.FindStringExact' must have class/struct/union type
D:\新建文件夹\Ex_CityCode2\CityZoneDlg.cpp(84) : error C2228: left of '.GetItemDataPtr' must have class/struct/union type
D:\新建文件夹\Ex_CityCode2\CityZoneDlg.cpp(87) : error C2228: left of '.SetItemDataPtr' must have class/struct/union type
D:\新建文件夹\Ex_CityCode2\CityZoneDlg.cpp(91) : error C2601: 'OnSelchangeCombo1' : local function definitions are illegal
D:\新建文件夹\Ex_CityCode2\CityZoneDlg.cpp(105) : error C2601: 'OnDestroy' : local function definitions are illegal
执行 cl.exe 时出错.
I'm new,what's the matter with it? look for help........
- 程序又出问题了,不知怎么了
- 这是怎么了?苹果iPhone 5又出问题
- 新iPad又出问题了
- 肯跌又出问题了
- 今天不知怎么了
- 电脑不知怎么了
- 妈妈的,dnn又出问题了
- “又拍云”可能出问题了
- 我又怎么了
- 腾讯最近是怎么了,老出问题
- 出问题了
- 出问题了,,
- 这几天csdn的blog又出问题了
- 你又怎么了啊
- 它怎么又去了。
- 怎么又用到了开始这个词了
- 昨天好好地,今天Tocat怎么就出问题了呢
- C盘不知怎么满了怎么处理
- Http的常见错误解析
- 在PHP中用Socket发送电子邮件
- 当被鄙视成为一种习惯,心里也多了一份坦然
- 线程优先级别
- perl模块之MIME::Lite发送有附件的邮件
- 程序又出问题了,不知怎么了
- 2012毕业找工作记录点滴
- IT外企那点事儿
- IIS中文域名绑定方法
- python学习笔记之一
- linux定时执行crontab 执行数据库备份
- 2011-10-25
- 什么是反射?
- SAX解析XML文档