关于MFC多媒体定时器问题,求帮助
开启了一个10ms的多媒体定时器,但是每过一段时间定时器就会超时好长时间
TIMECAPS tc;
if (timeGetDevCaps(&tc, sizeof(TIMECAPS)) != TIMERR_NOERROR)
// Error; application can't continue.
wTimerRes = min(max(tc.wPeriodMin,TARGET_RESOLUTION), tc.wPeriodMax);
timeBeginPeriod(wTimerRes);
timeSetEventRslt = timeSetEvent(
10, // delay
wTimerRes, // resolution (global variable)
(LPTIMECALLBACK)TenMsecTimer, // callback function
wTimerRes/*reinterpret_cast<DWORD>(this)*/, // user data
TIME_PERIODIC/* | TIME_CALLBACK_FUNCTION | TIME_KILL_SYNCHRONOUS*/ ); // periodic call to callback func
if(timeSetEventRslt == NULL ) MessageBox(_T("TimeSetEvent fail. Maybe delay is not in the range of the minimum and maximum "));