void CserviceDlg::OnLvnGetdispinfoList1(NMHDR *pNMHDR, LRESULT *pResult) { NMLVDISPINFO *pDispInfo = reinterpret_cast<NMLVDISPINFO*>(pNMHDR); // TODO: 在此添加控件通知处理程序代码 LV_ITEM* pItem= &(pDispInfo)->item; int iItem = pItem->iItem; if (pItem->mask & LVIF_TEXT) { CString text; //Which column? if(pItem->iSubItem == 0) //Text is name text =m_Adocon.m_pRecordset->GetCollect("编号");/*m_Adocon.m_pRecordset->GetCollect("编号");*/ else text="bb"; //Copy the text to the LV_ITEM structure //Maximum number of characters is in pItem->cchTextMax lstrcpyn(pItem->pszText, text, pItem->cchTextMax); if (text=="bb") { m_Adocon.m_pRecordset->MoveNext(); } } *pResult = 0; }
{
NMLVDISPINFO *pDispInfo = reinterpret_cast<NMLVDISPINFO*>(pNMHDR);
// TODO: 在此添加控件通知处理程序代码
LV_ITEM* pItem= &(pDispInfo)->item;
int iItem = pItem->iItem; if (pItem->mask & LVIF_TEXT)
{
CString text; //Which column?
if(pItem->iSubItem == 0)
//Text is name
text =m_Adocon.m_pRecordset->GetCollect("编号");/*m_Adocon.m_pRecordset->GetCollect("编号");*/ else
text="bb";
//Copy the text to the LV_ITEM structure
//Maximum number of characters is in pItem->cchTextMax
lstrcpyn(pItem->pszText, text, pItem->cchTextMax);
if (text=="bb")
{
m_Adocon.m_pRecordset->MoveNext();
}
}
*pResult = 0;
}
那就在点击的响应函数中设个断点,单步调试跟一下,看在哪出的问题。
我设置断点了,调试结果是我点击表格行和向下拉和向上拉滚动条,都会产生Getdispinfo而且pItem->iItem都会加1所以才会产生这种问题,但我不知道怎么解决啊,求解