Hi,
Debugging a program I have come across an oddity I think. When an exception is thrown I have always used the line number it gives back to navigate to it and fix it but this time it appears to be Form1.ActiveForm.Update() that is casung the problem. The exception returns two line numbers 2957 & 3851, 3851 is the call to the function with the Form1.ActiveForm.Update() in it. I am fairly certain this is not due to the call as it runs through this function once with no problem, the only major difference is this time it is be called by a timer.
Any ideas please
Glenn
(x)
GlennP
296
296
Hmm comment out Form1.ActiveForm.Update added a try catch to call error cured(ish) needs more testing! Any info on Update much appreciated though. Glenn

3 answers
The bug/error/exception seems to have moved, any info much appreciated though!
Glenn
answered 5 months ago by:
296
The only reason I can think of why Form1.ActiveForm.Update would throw an exception is if there's currently no active form and so the ActiveForm property is null.
This would be the case if, say, a MessageBox were showing or some other application had the input focus.
You could guard against it by checking first that ActiveForm is not null before calling Update() on it:
answered 5 months ago by:
12813
If the Update method is being called by an asynchronous timer, it could be a threading issue. The thread the timer is running from would not have access to the UI thread
answered 5 months ago by:
2135