Skip to main content
gamedev.net
🔒 Locked

TimerProc stuff

Started by Zipster Mar 24, 2000 at 11:20 PM 1 replies 700+ views
Original Post
Zipster
Zipster
I have a SetTimer like this: SetTimer(main_window, 1, 1000, TimerProc); and a TimerProc Callback function like this: VOID CALLBACK TimerProc(HWND window, UINT message, UINT Id, DWORD dwTime) { switch(Id) { case(1): { sec++; } break; } } this is correct, however the Id is never one because I notice sec never increments. however, when i change it to this: VOID CALLBACK TimerProc(HWND window, UINT message, UINT Id, DWORD dwTime) { sec++; } it works. i guess ill have trouble getting it to be able to distingquish between different timers, if it can''t handle one timer.
MadKeithV
MadKeithV
I think the problem is this: you actually register a timerproc function, AND an ID.
I think the windoze framework usually uses the WM_TIMER message handler framework only when you do not specifiy a timerproc..Though it SHOULD work the way you specify it


~ Mad Keith ~
**SoftwareMode**
It's only funny 'till someone gets hurt.And then it's just hilarious.Unless it's you.
Zipster
Zipster
i figured in out. even though i wanted the ID to be one, that id wasn''t availbale, so it went to the next avaliable id, like 234 or 645.

the SetTimer function returns the actuall id that is chose, so i just set a global variable timer1 equal to the function, and i have the true id.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.