关于CListCtrl的低级问题
用下列语句向LIST写入从数据库读出的数据(均为字符串,且均不为空),用Debug发现setitemtext语句返回值为0,即不能成功执行。请问是什么原因,可以怎么改正?
for ( int nListEntry = 0 ; ! m_dSet.IsEOF () ; nListEntry ++ )
{
m_QueryResultList . InsertItem ( nListEntry, LPCTSTR ( itoa (nListEntry+1, szBuffer, 10 ) ), 0 );
m_QueryResultList . SetItemText ( nListEntry, 1, test );
m_QueryResultList . SetItemText ( nListEntry, 2, LPCTSTR ( m_dSet.m_PER_NAME ) );
m_QueryResultList . SetItemText ( nListEntry, 3, LPCTSTR ( m_dSet.m_PER_SEX ) );
m_QueryResultList . SetItemText ( nListEntry, 4, LPCTSTR ( m_dSet.m_PER_HOMETOWN ) );
m_dSet.MoveNext (); }