MFC 循环向Combo Box添加项
while(!m_Recordset->adoEOF){VARIANTvar;var=m_Recordset->Fields->Item["FileName"]->Get...
while (!m_Recordset->adoEOF)
{
VARIANT var;
var = m_Recordset->Fields->Item["FileName"]->GetValue();
if ( var.vt == VT_NULL )
{
continue;
}
else
{
//获得文件名
FileAll = (char*)(_bstr_t)m_Recordset->GetCollect(_variant_t("FileName"));
//填充
//GetDlgItem(IDC_COMBO1)->SetWindowText(FileAll);
combownd1->AddString(FileAll);//添加一个选项
}
m_Recordset->MoveNext();
}
combownd1->SetCurSel(0);//设置默认显示的是第一个"1"
为什么运行后只有一项?? 展开
{
VARIANT var;
var = m_Recordset->Fields->Item["FileName"]->GetValue();
if ( var.vt == VT_NULL )
{
continue;
}
else
{
//获得文件名
FileAll = (char*)(_bstr_t)m_Recordset->GetCollect(_variant_t("FileName"));
//填充
//GetDlgItem(IDC_COMBO1)->SetWindowText(FileAll);
combownd1->AddString(FileAll);//添加一个选项
}
m_Recordset->MoveNext();
}
combownd1->SetCurSel(0);//设置默认显示的是第一个"1"
为什么运行后只有一项?? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询