m_wndList.SetItemText(Row,1,(LPCTSTR)(CString)m_rs.m_UserName);
m_wndList.SetItemText(Row,2,(LPCTSTR)(CString)m_rs.m_password);
用int id=_ttoi(m_wndList.GetItemText(nItem,0));
发现id的值是很长的一个负数,不是某一行第一列的id,
请问怎么使用GetItemText取第一列的数并转换成整型?
3 个解决方案
#1
int id=_ttoi((LPCTSTR)m_wndList.GetItemText(nItem,0));
#2
先看看m_wndList.GetItemText(nItem,0)的结果是什么
#3
CString str = CListCtrl::GetItemText(...);
_ttoi(...);
_tcstoul(..);
_ttoi(...);
_tcstoul(..);
#1
int id=_ttoi((LPCTSTR)m_wndList.GetItemText(nItem,0));
#2
先看看m_wndList.GetItemText(nItem,0)的结果是什么
#3
CString str = CListCtrl::GetItemText(...);
_ttoi(...);
_tcstoul(..);
_ttoi(...);
_tcstoul(..);