数据问题
static CTypedPtrList<CObList, CObjOffice *> m_queueOffice;
。
void CAuxPageOffice::ShowListInfo()
{
CWnd *pWnd = GetDlgItem(IDC_EDIT_AUXOFFNO);
pWnd->GetWindowText(strOffNO);
dwNO = atol(strOffNO);
pWnd = GetDlgItem(IDC_EDIT_AUXOFFNAME);
pWnd->GetWindowText(strOffName);
pWnd = GetDlgItem(IDC_EDIT_AUXOFFSPELL);
pWnd->GetWindowText(strOffSpell);
pWnd = GetDlgItem(IDC_EDIT_AUXOFFREMARK);
pWnd->GetWindowText(strOffRe);
CObjOffice *obj = new CObjOffice();
obj->set_OfficeNO(dwNO);
obj->set_OfficeName(strOffName);
obj->set_OfficeSpell(strOffSpell);
obj->set_OfficeRe(strOffRe);
FindObj(obj);//调用
。
}
bool CAuxPageOffice::FindObj(CObjOffice * obj)
{
POSITION pos = m_queueOffice.GetHeadPosition();
bool bExist = false;
if( *obj == *m_queueOffice.GetAt(pos))//这里出错了,去掉 * 就可以,但这样比较的是地址,我想比较值
{
bExist = true;
break;
}
。
}错误信息::\Work\Report\AuxPageOffice.cpp(225) : error C2678: binary '==' : no operator defined which takes a left-hand operand of type 'class CObjOffice' (or there is no acceptable conversion)
static CTypedPtrList<CObList, CObjOffice *> m_queueOffice;
。
void CAuxPageOffice::ShowListInfo()
{
CWnd *pWnd = GetDlgItem(IDC_EDIT_AUXOFFNO);
pWnd->GetWindowText(strOffNO);
dwNO = atol(strOffNO);
pWnd = GetDlgItem(IDC_EDIT_AUXOFFNAME);
pWnd->GetWindowText(strOffName);
pWnd = GetDlgItem(IDC_EDIT_AUXOFFSPELL);
pWnd->GetWindowText(strOffSpell);
pWnd = GetDlgItem(IDC_EDIT_AUXOFFREMARK);
pWnd->GetWindowText(strOffRe);
CObjOffice *obj = new CObjOffice();
obj->set_OfficeNO(dwNO);
obj->set_OfficeName(strOffName);
obj->set_OfficeSpell(strOffSpell);
obj->set_OfficeRe(strOffRe);
FindObj(obj);//调用
。
}
bool CAuxPageOffice::FindObj(CObjOffice * obj)
{
POSITION pos = m_queueOffice.GetHeadPosition();
bool bExist = false;
if( *obj == *m_queueOffice.GetAt(pos))//这里出错了,去掉 * 就可以,但这样比较的是地址,我想比较值
{
bExist = true;
break;
}
。
}错误信息::\Work\Report\AuxPageOffice.cpp(225) : error C2678: binary '==' : no operator defined which takes a left-hand operand of type 'class CObjOffice' (or there is no acceptable conversion)
解决方案 »
- 高分求解,怎样通过CMarkup类,生成如下XML文件的使用方法,求写出代码,谢谢
- 急急急,牛人们都是咋保证从数据表里取出来的记录别人不能再取到?
- 请问为什么我把Radio Button选中Group以后,就变成多选了呢?
- 大虾救命啊
- 关于数据库中音视频文件的存储与调用问题
- 请教:为什么我的程序中字体显示总是旋转90度的?
- 在VC中如何向并口写数据?
- 以下的死程序代码为什么对双核没用的啊?
- VS上做一个C++编辑器,如何调用外部编译器
- CMFCPropertyGridFileProperty,CMFCPropertyGridFontProperty自带按钮调整
- 我做了一个字符串转换成时间的绝对秒的程序出现了错误,请大家帮忙看一下
- 怎样能马上知道一个计算机注销了和登陆了?
意思是说没有重载"=="操作符吧,你试试重载以下CObjOffice 的"=="操作符