Invoke datagridview cellvalidating

I found this when I was so tired of the whole app that I put try/catch clauses around every single method I got and even several per method if they were long. But as to your question yes it reached it as often as it should. GUI thread, timer thread and another thread for the receive method.

And wrote output to console in the catch So Invoke in a way worked perfectly, but I wonder why VS2005 showed me the Invoke() with exception, when it happened in another thread and another class in my project. The timer thread reads from a Ring Buffer and write it to a Rich Text Box control.

At the moment tho I am tempted to put a try catch over the invoke and just call invoke again if it fails, until it doesnt fail anymore. NOTE: Adding info to the ringbuffer happens in another thread. This may come with like 200 or so lines of 80 character long text per second. It seems that you are using the kind of timer that calls back on a separate thread, which is why you are having to use a delegate and this. Do you have any clues as to what can cause this All the functions called from the else clause in the add Rich Text method has their own try/catch around them and should pick up any faults happening in them. Thanks Sid and see if that gets rid of the exception.

Its added to the Ring Buffer, the method that adds to ringbuffer lock(array. Timer, which calls back on the UI thread Then you could just mess about with controls on the form directly, without having to mess about with delegates. Timer I test if output_rt (the richtextbox) is invokerequired since that is the control I am attempting to manipulate. You're probably getting the Index Out Of Bounds exception because the Invoke method is trying to get at elements 0 and 1 of the params array (which doesn't exist)...

I found this when I was so tired of the whole app that I put try/catch clauses around every single method I got and even several per method if they were long.

Thanks a lot You have been great help snakay ahaa, still have a curious problem.

You see it when the Invoke returns because it rethrows it and it's now unhandled.

That's where I was going with the breakpoint question, if it reached there the call to Invoke wasn't causing the exception, the code that was being invoked caused the exception.

Sync Root) before doing any operation to the array. I am invoking the delegate to the add Rich Text_timer() method which takes no arguments.

Same with the Get Array3000 in the above quoted source code, it locks the array before it returns it (since it need to do a small operation before returning it). It seems that you are using the kind of timer that calls back on a separate thread, which is why you are having to use a delegate and this. The timer method first takes arguments but I dont invoke that one.

Leave a Reply