views:

28

answers:

1

I have a windows forms project. It has a main form derived from System::Windows::Forms::Form which I can open in designer without any problems. If I try and close designer though, it kills Visual Studio (v2008 with SP1).

The form includes a tab control which has pages with various System::Windows::Forms::UserControl derived forms. So I'm guessing the fault lies somewhere in the main form or one of those sub-components. The problem is I don't know how I can narrow it down at all?

I've tried debugging from another copy of the developer environment, but I can't get the break points to work.

Any suggestions on how to attack this problem would be very gratefully received!

[EDIT] By trial and error I've narrowed it down to a single System::Windows::Forms::UserControl derived control, and the crash only occurs when that control is nested within a System::Windows::Forms::TabControl. Is there something the tab control does when it closes which could cause the crash perhaps?

+2  A: 

Try open another instance of VS, go to Debug -> attach to process, choose another VS from the list (the one you have your project in), then put the breakpoint somewhere in your application (somewhere it is likely to cause this error), and run you project and you should be able to debug it and find what make VS crash.

Good luck

Vitalij
I've tried that (in the constructor and in `InitializeComponent`) and it won't enable the breakpoint. If I hover over the breakpoint it says "The breakpoint will not currently be hit. No Symbols have been loaded for this document". Any ideas?
Jon Cage
Also, when I then try and load the form in the other project the designer gives up and says "The file 'c:\SomePath\Form1.h' does not support code parsing or generation because it is not contained within a project that supports code. "
Jon Cage
@Jon Cage: Enable unmanaged debugging too.
leppie
@leppie: How? I tried this: http://msdn.microsoft.com/en-us/library/tdw0c6sf.aspx but the only option I could see was `Debugger Type`. Changing that to `Mixed` didn't seem to help?
Jon Cage