NOT the answer, I also want to know
Hi,
I have had the same thing happened to me. I put a AfxMessageBox() inside my OnTimer() and only for the first couple of times it displayed, afterwards nothing. What's up with CListView?
I'd like to know what the reason and work-around is.
Good luck.
Re: NOT the answer, I also want to know
I ended up sorting this one out myself. My original OnTimer looked something like:
void MyClass::OnTimer (int nEvent)
{
MessageBeep(0);
CListView::OnTimer(nEvent);
}
I don't have the code in front of me so don't hold me to the syntax... Anyway, I ended up replacing that with this:
void MyClass::OnTimer (int nEvent)
{
if (nEvent == MY_EVENT)
MessageBeep(0);
else
CListView::OnTimer(nEvent);
}
I actually ported this app from a dialog-based app that had that first OnTimer and everything worked fine. But I found that - I guess - if you call the CListView's OnTimer with an event that it's not expecting, it gets heartburn. I tried singlestepping into it once and ended up with an access-vio. Since I was in a hurry to get this app done and onto to other stuff, I was just happy to get it to run.
Force be with you.
Curt
Re: CListView and WM_TIMER
I have found the problem is that the listview eat the timer message but I don't know the solution yet.
I suggest you setting the timer process to do the same thing on SetTimer(,,,TimerProc).