Instead of a Timer (dragged onto the form) try a "coded" timer.
Sorry, I only have some old old vb.net code for this one currently.
Outside of "addhandler" ( += new EventHandler) it should be easy enough to
translate)
Private m_doTheWorkTimer As Timer
private sub RegisterTimer()
Dim dueTime As Long
Dim period As Long
' DUE TIME looks like it is the DELAY time .. from the time the service
starts,
' Until this specfic TIMER kicks in. So a Delay Time of 20000
' Will DELAY this timer shooting off until 20 seconds (20000 ms) after the
service starts
dueTime = 20000
period = 5000
' the magic bullet, notice the part after "AddressOf", which is the method
Dim timerHandler = New TimerCallback(AddressOf BeepClass.GoBeep)
m_doTheWorkTimer = New Timer(timerHandler , Me, dueTime, period)
end sub
''Above is the Code Behind of the Windows Service
Public Class BeepClass
Public Shared Sub GoBeep(ByVal state As Object)'' this uses a built in
delegate, with "state as Object" as the generic argument list
Beep()
End Sub
End Class
Also, you may want to read this post (the result authored by me)
http://groups.google.com/groups/sear...r+&qt_s=Search
"archana" <tr**************@yahoo.comwrote in message
news:11*********************@i42g2000cwa.googlegro ups.com...
Hi all,
I want to know about interval of timer.
I am using timer in windows service.I head somewhere that when i set
interval property of timer while setting interval, restart time of Pc
is consider.
My question is if i am using timer in my windows service, is there any
place where interval related information like interval set used by my
application is stored.
My problem is my timer start behaving erractically after 49.7 days. So
instead of restarting PC i reinstall service and problem gets solved.
So i want to know where in system timer related information is stored.
If anyone can shed some light on it then it will be really benefical
for me.
thanks in advance.