以ListView为BasicClass创建一个工程,程序中需要用到定时器。void CMy3535View::OnInitialUpdate()
{
CListView::OnInitialUpdate(); SetTimer (1,2000,NULL);
// TODO: You may populate your ListView with items by directly accessing
// its list control through a call to GetListCtrl().
}void CMy3535View::OnTimer(UINT nIDEvent)
{
int a ;
a = 1;
CListView::OnTimer(nIDEvent);
}可是OnTimer只触发两次就不工作了,这是为什么?是不是在CListView中不能使用SetTimer??如果我想每20秒钟把CListCtrl上的数据内容存储到D:/111.txt中,该怎么办????
{
CListView::OnInitialUpdate(); SetTimer (1,2000,NULL);
// TODO: You may populate your ListView with items by directly accessing
// its list control through a call to GetListCtrl().
}void CMy3535View::OnTimer(UINT nIDEvent)
{
int a ;
a = 1;
CListView::OnTimer(nIDEvent);
}可是OnTimer只触发两次就不工作了,这是为什么?是不是在CListView中不能使用SetTimer??如果我想每20秒钟把CListCtrl上的数据内容存储到D:/111.txt中,该怎么办????
注意这一段
Also see:
Knowledge Base article Q250614: HOWTO: Sort Items in a CListCtrl in Report View
Knowledge Base article Q200054: PRB: OnTimer() Is Not Called Repeatedly for a List Control
不要放在OnInitialUpdate()里