win32 - timeSetEvent(): what is wrong with these function?
timeSetEvent() - https://msdn.microsoft.com/en-us/lib...=vs.85%29.aspx
the TIME_PERIODIC is for a time cycle and the TIME_ONESHOT is for it just once, right?
if so why i'm getting unexpected results? :(
Code:
void Stop()
{
if(timerid!=NULL)
{
timeKillEvent(timerid);
//timeEndPeriod (m_uResolution);
timerid=0;
}
}
void Start(bool periodic=true)
{
blnPeriodic=periodic;
Stop();
/*TIMECAPS tc;
timeGetDevCaps(&tc, sizeof(TIMECAPS));
m_uResolution = tc.wPeriodMin;
timeBeginPeriod(m_uResolution);*/
UINT timeoptions=0;
if(blnPeriodic==true)
timeoptions=TIME_PERIODIC;
else
timeoptions=TIME_ONESHOT;
timerid = timeSetEvent(intInterval, intInterval/2, &Timer::_TimerProc, (DWORD_PTR)this,timeoptions);
}
Code:
if(blnPeriodic==true)
timeoptions=TIME_PERIODIC;
else
timeoptions=TIME_ONESHOT;
please correct me these. i'm getting problems with it without understand what is wrong :(
1 timer,TIME_PERIODIC, is just do it once :(