At 1:31 AM -0500 2/24/06, [EMAIL PROTECTED] wrote:

I am not sure what is happening exactly but it seems that at times my program
gets into an endless graphics drawing loop. Actually it just appears to hang
up and if I pause it in the debugger its some random point in the draw
routine. These kinds of bugs are very difficult to track because the debugger itself interfers with the process. Does anyone have any tips on how to isolate the problem?

Well, first just check your code for the most common source of your problem: one of your Paint events is causing something to refresh -- which, of course, triggers the Paint event again. Paint should never change control state, or do anything else except paint to the given graphics.

In fact, if you pause it in the debugger and look at the stack, you ought to be able to see exactly where the loop is and how it's re-entering.

If still stumped, then start commenting things out, starting with your Paint events. When you comment out a Paint event, and the problem goes away, then that event's code is involved in the problem, so you know to focus there.

As for debugging, this sort of problem is best tackled with the remote debugger. This will of course require two computers (ideally, side by side). Another option is to forego the IDE's debugger and make liberal use of System.DebugLog instead.

HTH,
- Joe

--

Joseph J. Strout
[EMAIL PROTECTED]
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to