SetTimer & TimerProc
Can someone tell me why I get this error when trying to
compile this code using VC++ 5.0?
error C2664: ''SetTimer'' : cannot convert parameter 4 from
''void (void *,unsigned int,unsigned int,unsigned long)'' to
''int (__stdcall *)(void)''
##################### CODE ###################################
int PlaySnd(void)
{
SetTimer(hwndMain,PLAYBUTTON_TIMER_ID,
nSndSampleLen,PlayTimerProc);
return 0;
}
VOID CALLBACK PlayTimerProc(HWND hwnd,UINT message, UINT iTimerID, DWORD dwTime)
{
// Stuff.....
}
###################### END OF CODE ##############################
Thanks
Timer call backs dont (ie cant) take any parameters, and return as int
Edited by - Magmai Kai Holmlor on November 11, 2000 1:38:47 AM
//no ah ahVOID CALLBACK PlayTimerProc(HWND hwnd,UINT message, UINT iTimerID, DWORD dwTime)int PlayTimerProc(){return(false);}
Edited by - Magmai Kai Holmlor on November 11, 2000 1:38:47 AM
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
November 12, 2000 04:02 AM
You will need to use a cast on the last parameter of the SetTimer function, ie do this:
SetTimer(hwndMain,PLAYBUTTON_TIMER_ID, nSndSampleLen,(TIMERPROC)PlayTimerProc);
Hope this helps.
SetTimer(hwndMain,PLAYBUTTON_TIMER_ID, nSndSampleLen,(TIMERPROC)PlayTimerProc);
Hope this helps.
good question ha ha :-)
I like game very much, so I want to make more people like it !
I like game very much, so I want to make more people like it !
Life is :-(Life is :-)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement