请教一个关于列表框的问题

ai5266 2009-03-10 01:48:52
void MakeHsvMap(void)
{
CString str="建立HSV查找表...";
((CListBox*)GetDlgItem(IDC_LIST1))->AddString(str);
int count=((CListBox*)GetDlgItem(IDC_LIST1))->GetCount();
char ch;
itoa(count,&ch,10);
MessageBox(&ch); //这里可以知道条目已经增加了,但是为什么列表框中没有显示,直到下面的循环结束后才显示出来
for( int i = 0; i<16777216; i++)
{
.......
}
}

请问这是什么原因造成的,怎样能够立马显示出来
非常感谢!!!
...全文
81 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
ai5266 2009-03-10
  • 打赏
  • 举报
回复
界面是会死掉,不过列表框的问题算是解决了,非常感谢。
Tinary3v0 2009-03-10
  • 打赏
  • 举报
回复
void MakeHsvMap(void) 
{
CString str="建立HSV查找表...";
((CListBox*)GetDlgItem(IDC_LIST1))->AddString(str);
int count=((CListBox*)GetDlgItem(IDC_LIST1))->GetCount();
char ch;
itoa(count,&ch,10);
((CListBox*)GetDlgItem(IDC_LIST3))->UpdateWindow(); //增加这么一句
for( int i = 0; i <16777216; i++) //另外看能不能再开一个线程来执行这么打大的For循环 不然虽然能显示了 但界面会死掉
{
//.......
}
}

15,976

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧