Click here to Skip to main content
15,923,576 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Compare two datasets Pin
Wendelius13-Oct-08 6:20
mentorWendelius13-Oct-08 6:20 
GeneralRe: Compare two datasets Pin
Sebastian T Xavier13-Oct-08 6:45
Sebastian T Xavier13-Oct-08 6:45 
GeneralRe: Compare two datasets Pin
Wendelius13-Oct-08 7:20
mentorWendelius13-Oct-08 7:20 
QuestionConnecting to access using vb6.0 Pin
Michelle Shoniwa13-Oct-08 4:21
Michelle Shoniwa13-Oct-08 4:21 
AnswerRe: Connecting to access using vb6.0 Pin
Dave Kreskowiak13-Oct-08 4:33
mveDave Kreskowiak13-Oct-08 4:33 
GeneralRe: Connecting to access using vb6.0 Pin
Mycroft Holmes13-Oct-08 17:57
professionalMycroft Holmes13-Oct-08 17:57 
AnswerRe: Connecting to access using vb6.0 Pin
Paul Conrad13-Oct-08 12:11
professionalPaul Conrad13-Oct-08 12:11 
QuestionSystem.Threading.Timer - stops executing on its own Pin
alexvw13-Oct-08 3:40
alexvw13-Oct-08 3:40 
Good day everybody,

I have placed a Timer (System.Threading.Timer) in my app that fires every 1 sec. Every now and then, it just stops runinng. The app does not report any errors, and therefore I have no idea what so ever. Here is the code:

//Assing timer's callback sub
Private Sub FrmMain_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load

'*Grade Engine
Dim GradeTmrDel As New Threading.TimerCallback(AddressOf GradeTmr_Routine)
GradeTmr = New Threading.Timer(GradeTmrDel, Nothing, 2000, 1000)

End Sub

//this is the callback sub
Private Sub GradeTmr_Routine(ByVal iState As Object)
Static InProcess As Boolean
Dim Msg(), SubMsg(1), NextGrade As String

If InProcess Then Return
InProcess = True
Try
NextGrade = Get_NextGrade()
......
End If
Catch ex As InvalidOperationException
Handle_Er(Err, "GradeTmr") : End
Catch
Handle_Er(Err, "GradeTmr")
Finally
InProcess = False : Grading = False
End Try
End Sub

//Error handler routine - writes to eventlog and posts a message on screen
Private Sub Handle_Er(ByRef Er As ErrObject, ByRef Source As String)
If StatBar.Panels(1).Text = "" Then
StatBar.Panels(0).Text = "Warning! at least one error has been logged!" : StatBar.Panels(1).Icon = New System.Drawing.Icon("W95MBX03.ICO") : StatBar.Panels(1).Text = "Clear"
StatBar.Panels(0).ToolTipText = "Use the Event Viewer to access error's data" : StatBar.Panels(1).ToolTipText = "Click to reset!"
End If
syscorelog.WriteEntry(Er.Description & Chr(10) & Source & Chr(10) & Er.GetException.StackTrace, EventLogEntryType.Error)
End Sub

Thanks for your guidance!

Alex.
AnswerRe: System.Threading.Timer - stops executing on its own Pin
Dave Kreskowiak13-Oct-08 3:58
mveDave Kreskowiak13-Oct-08 3:58 
GeneralRe: System.Threading.Timer - stops executing on its own Pin
alexvw14-Oct-08 7:06
alexvw14-Oct-08 7:06 
GeneralRe: System.Threading.Timer - stops executing on its own Pin
Dave Kreskowiak14-Oct-08 7:14
mveDave Kreskowiak14-Oct-08 7:14 
GeneralRe: System.Threading.Timer - stops executing on its own Pin
alexvw15-Oct-08 0:12
alexvw15-Oct-08 0:12 
Questionhow to draw over image..... Pin
Vineet Swami13-Oct-08 3:14
Vineet Swami13-Oct-08 3:14 
AnswerRe: how to draw over image..... Pin
Dave Kreskowiak13-Oct-08 4:01
mveDave Kreskowiak13-Oct-08 4:01 
GeneralRe: how to draw over image..... Pin
Vineet Swami13-Oct-08 5:07
Vineet Swami13-Oct-08 5:07 
GeneralRe: how to draw over image..... Pin
Dave Kreskowiak13-Oct-08 5:16
mveDave Kreskowiak13-Oct-08 5:16 
GeneralRe: how to draw over image..... Pin
Vineet Swami13-Oct-08 19:38
Vineet Swami13-Oct-08 19:38 
GeneralRe: how to draw over image..... Pin
Dave Kreskowiak14-Oct-08 1:36
mveDave Kreskowiak14-Oct-08 1:36 
QuestionCalculating an MD5 Hash for Large Amount of data in VB.net Pin
Piyush Vardhan Singh13-Oct-08 3:02
Piyush Vardhan Singh13-Oct-08 3:02 
AnswerRe: Calculating an MD5 Hash for Large Amount of data in VB.net Pin
Dave Kreskowiak13-Oct-08 3:17
mveDave Kreskowiak13-Oct-08 3:17 
Questioncan anyone help me with this or atleast give an idea Pin
jeipiyaku13-Oct-08 0:05
jeipiyaku13-Oct-08 0:05 
AnswerRe: can anyone help me with this or atleast give an idea Pin
Ashfield13-Oct-08 0:19
Ashfield13-Oct-08 0:19 
AnswerRe: can anyone help me with this or atleast give an idea Pin
Mycroft Holmes13-Oct-08 18:01
professionalMycroft Holmes13-Oct-08 18:01 
GeneralRe: can anyone help me with this or atleast give an idea Pin
jeipiyaku14-Oct-08 20:17
jeipiyaku14-Oct-08 20:17 
GeneralRe: can anyone help me with this or atleast give an idea Pin
Mycroft Holmes14-Oct-08 20:48
professionalMycroft Holmes14-Oct-08 20:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.