I'm actually running an email checker program which uses the Timer API to check the mail every so often. The problem is that the mail gets checked more often then the interval on the timer and I can't figure out why - In a module I have declared:
Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As
Long, ByVal lpTimerFunc As Long) As Long
Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
Global TimerID As Long
Public Sub RunProgram()
.......
TimerID = SetTimer(0, 0, Interval * 1000, AddressOf MyTimer)
......
End Sub
Public Sub MyTimer(hwnd As Long, msg As Long, idTimer As Long, dwTime As Long)
Form1.CheckMail
End Sub
The symptoms are that the program tries to check the mail while the first winsock connection still exists (i.e. too soon) and hence I get an error saying the protocol was in an incorrect state for sending.
Any ideas?
Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As
Long, ByVal lpTimerFunc As Long) As Long
Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
Global TimerID As Long
Public Sub RunProgram()
.......
TimerID = SetTimer(0, 0, Interval * 1000, AddressOf MyTimer)
......
End Sub
Public Sub MyTimer(hwnd As Long, msg As Long, idTimer As Long, dwTime As Long)
Form1.CheckMail
End Sub
The symptoms are that the program tries to check the mail while the first winsock connection still exists (i.e. too soon) and hence I get an error saying the protocol was in an incorrect state for sending.
Any ideas?