Red X Caused by Windows Control

Hi,

I’m overriding GoControl’s CreateControl method to house a windows control inside the GoView diagram. Everything’s find until my windows control throws an exception. At that time the diagram just displays a big red X and otherwise swallows the error. This makes it a real pain to debug. Is there any way to propogate the exception up to my application that contains the diagram or some other way to get these unhandled exceptions?

What’s the control you are embedding?



Do you even have an idea of what is causing the exception? Is it caused by code in your GoControl container class?

We are embedding our own custom windows control composed of a bunch of other things.

Upon further investigation, the exception being swallowed was coming from calling GoView.Invalidate() (which I don’t think we need) so it wasn’t really an exception being thrown from our code. All of our exceptions thrown show up and break execution in the debugger (so at least I know where they come from), but still take down the whole diagram.

So, I guess my question now is if there is some event or something I can subscribe to such as UnhandledException so I can recover without taking down the diagram.

Just to see if I could reproduce your issue, I took Demo1 (NodeLinkDemo in 4.0) and RectWithCheckBox. I modified it to throw an exception if I type the “E” key to the checkbox. The app puts up an unhandled exception dialog, but it doesn’t mess up the diagram. So, I don’t see what you’re seeing.



GoDiagram is a container for your control, but it isn’t necessarily on the stack when the code in your control throws an exception…in fact, it probably isn’t.

Thank you for checking it out.

I’ll investigate what’s going on a little further and get back to you.