我的两个list box的ID 关联变量分别为m_listLowDisp,m_listHighDisp。为什么只有在m_listLowDisp对应的组合框有内容显示的时候,另外一个组合框才有显示呢,麻烦各位高手看看,小弟真是不胜感激。具体代码如下:
void CAlertDlg::RefreshData()
{
//低于最小库存
m_listLowDisp.DeleteAllItems();
m_listLowDisp.SetRedraw(FALSE);

_variant_t Holder, strQuery;
    strQuery= "select * from goods where G_current_number<=G_min_number";
theApp.ADOExecute(theApp.m_pRs, strQuery);
    int iCount = theApp.m_pRs->GetRecordCount();
if ( 0==iCount ) 
return;
theApp.m_pRs->MoveFirst();

int i=0;
while(!theApp.m_pRs->adoEOF)
{
Holder = theApp.m_pRs->GetCollect("G_code");
if(Holder.vt!=VT_NULL)
m_listLowDisp.InsertItem(i, (char*)(_bstr_t)Holder);

Holder = theApp.m_pRs->GetCollect("G_name");
if(Holder.vt!=VT_NULL)
m_listLowDisp.SetItemText(i,1, (char*)(_bstr_t)Holder);

Holder = theApp.m_pRs->GetCollect("G_type");
if(Holder.vt!=VT_NULL)
m_listLowDisp.SetItemText(i,2, (char*)(_bstr_t)Holder);


Holder = theApp.m_pRs->GetCollect("G_current_number");
if(Holder.vt!=VT_NULL)
m_listLowDisp.SetItemText(i,3, (char*)(_bstr_t)Holder);


Holder = theApp.m_pRs->GetCollect("G_min_number");
if(Holder.vt!=VT_NULL)
m_listLowDisp.SetItemText(i,4, (char*)(_bstr_t)Holder);

theApp.m_pRs->MoveNext();
i++;
}

m_listLowDisp.SetRedraw(TRUE); //高于最大库存
m_listHighDisp.DeleteAllItems();
m_listHighDisp.SetRedraw(FALSE);
    strQuery= "select * from goods where G_current_number>=G_max_number";
theApp.ADOExecute(theApp.m_pRs, strQuery);
     iCount = theApp.m_pRs->GetRecordCount();
if ( 0==iCount ) 
return;
theApp.m_pRs->MoveFirst();
i=0;
while(!theApp.m_pRs->adoEOF)
{
Holder = theApp.m_pRs->GetCollect("G_code");
if(Holder.vt!=VT_NULL)
m_listHighDisp.InsertItem(i, (char*)(_bstr_t)Holder);

Holder = theApp.m_pRs->GetCollect("G_name");
if(Holder.vt!=VT_NULL)
m_listHighDisp.SetItemText(i,1, (char*)(_bstr_t)Holder);

Holder = theApp.m_pRs->GetCollect("G_type");
if(Holder.vt!=VT_NULL)
m_listHighDisp.SetItemText(i,2, (char*)(_bstr_t)Holder);


Holder = theApp.m_pRs->GetCollect("G_current_number");
if(Holder.vt!=VT_NULL)
m_listHighDisp.SetItemText(i,3, (char*)(_bstr_t)Holder); Holder = theApp.m_pRs->GetCollect("G_max_number");
if(Holder.vt!=VT_NULL)
m_listHighDisp.SetItemText(i,4, (char*)(_bstr_t)Holder);

theApp.m_pRs->MoveNext();
i++;
}

  m_listHighDisp.SetRedraw(TRUE);




}