View Full Version : IShell_Timer
bkhe1
07-15-2002, 10:46 PM
Hi,
How can I schedule the timer at a fixed rate or do polling?
Cheers,
Bkhe
arunbangari
07-15-2002, 11:08 PM
Hi,
Use
ISHELL_SetTimer(IShell * pIShell, int32 dwMSecs, PFNNOTIFY pfn, void *pUser) API for scheduling. For further information refer BREW SDK.
Regards
Arun Bangari
bkhe1
07-15-2002, 11:22 PM
How can I repeat it ?
arunbangari
07-16-2002, 08:29 AM
Hi,
In ISHEL_SetTimer, the third parameter is the call back function. This function will be called after timer is expired. You call the ISHELL_SetTimer again in the callback function so that it will poll continuosly. Its a infinite loop.For eg your piece of code should like this.
ISHELL_SetTimer(pIShell, 1500, (PFNNOTIFY)callbackFunc, appdata structure(or any parameter for the callback function));
assuming your call back function takes parameter of app data structure,
void callbackFunc(appData)
{
//perform any necessary operation here...
//call again ISHELL_setTimer again
ISHELL_SetTimer(pIShell, 1500, (PFNNOTIFY)callbackFunc, appdata structure(or any parameter for the callback function));
}
In this way you have continuous polling. Lemme know if you have any problems.
Regadrs
Arun Bangari
vBulletin v3.0.13, Copyright ©2000-2009, Jelsoft Enterprises Ltd.