I have a well-defined derived CWnd class, say myClass. I set a timer at beginning: SetTimer (999, 1000, 0) inside a member function of myClass.
Then I defined my own timer service routine:
void myClass::OnTimer(UINT_PTR nIDEvent)
{
MessageBox("err","err",MB_OK);
MessageBeep(0xFFFFFFFF); // Beep
debugMsg ("hello");
serial.Write("hello", 5);
CDialog::OnTimer(nIDEvent);
}
But I found it doesn't work according to the four non-executed statements. That is, no message box is popped out, no beep sound, no hello message, no message sent to serial port. What's wrong with it?