Results 1 to 2 of 2

Thread: SetTimer/KillTimer

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    SetTimer/KillTimer

    I'm using SetTimer to create an event which then executes a sub when it's elapsed. I assign the event a unique id (lUID in this code)
    VB Code:
    1. SetTimer frmMain.hwnd, lUID, lEventInterval, AddressOf TimerProc
    but in the returning sub...
    VB Code:
    1. Sub TimerProc(ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long)
    2.  
    3. MsgBox nIDEvent
    4. KillTimer frmMain.hwnd, nIDEvent
    5.  
    6. End Sub
    nIDEvent always equals 275...what's up with that?

    The timer isn't getting killed because 275 is not the ID I gave it. Since I'm setting multiple timers, it would be useful if the ID I assigned it could get returned so I know which timer it was that elapsed.

    I hope somebody understands that, thanks

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    oh dear Penfold, looks like nobody knows

    Guess I'll have to think of something else...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width