部分代码我已经写好了,可是所有的都是一样的图标,怎么样让不同的行使用不同的图标呢?
请大家帮我写一点代码或是修改一下我的代码!
_RecordsetPtr m_pRecordset;  //记录集
/////////////////

CString strSQL;
strSQL="select * from equipment where (checker1 = '";
strSQL=strSQL+name+"' or checker2 = '";
strSQL=strSQL+name+"'";
strSQL=strSQL+") and isDeal = 'F'"; //查询语句
///////////////////////
HRESULT hTRes;
hTRes = m_pRecordset.CreateInstance(_T("ADODB.Recordset"));
if (SUCCEEDED(hTRes))
{
hTRes = m_pRecordset->Open((LPTSTR)strSQL.GetBuffer(130),
((CEngineMIBApp*)AfxGetApp())->m_pConn.GetInterfacePtr(),
adOpenDynamic,adLockPessimistic,adCmdText); //打开记录集
int i=0;

while(!(m_pRecordset->adoEOF))
{
if (((CEngineMIBApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("isQuitDeal")) == "T")
{
//////添加图标//////
m_HeadIcon.Create(16,16,TRUE,2,2);
m_HeadIcon.Add(AfxGetApp()->LoadIcon(IDI_ICONHEAD));
m_listRudeNote.SetImageList(&m_HeadIcon,LVSIL_SMALL);
// m_listRudeNote.SetTextColor( RGB(255,0,0) );
}
if (((CEngineMIBApp*)AfxGetApp())->GetStringFromVariant(m_pRecordset->GetCollect("isQuitDeal")) == "F")
{
//////添加图标//////
m_FalseIcon.Create(16,16,TRUE,2,2);
m_FalseIcon.Add(AfxGetApp()->LoadIcon(IDI_ICONFALSE));
m_listRudeNote.SetImageList(&m_FalseIcon,LVSIL_SMALL);
// m_listRudeNote.SetTextColor( RGB(0,0,0) );
}

i++;
if(!(m_pRecordset->adoEOF))
m_pRecordset->MoveNext(); //记录集指针向后移动CString
} // end of while