soconne

I have a VS 2005 C++ Winforms project and I placed a statusstrip and toolstrip on the form. I was able to compile and run it just fine. I then closed VS and reopened the project and now everytime I try and view the form in designer mode, it throws an exception saying:

The control System.Windows.Forms.StatusStrip has thrown an unhandled exception in the designer and has been disabled.

Exception:
Exception of the type 'System.OutOfMemoryException' was thrown.

Stack trace:
at System.Windows.Forms.StatusStrip.WndProc(Message& m)


Does anybody know why this is happening If I go in and delete the controls, as well as delete the solutions .ncb and .suo files I can view the form just fine AND add the controls back without any problem. But as soon as I save and close then reopen, it happens again.

Also note this does not happen in C# projects, only C++.


Re: Windows Forms General System.OutOfMemoryException caused by StatusStrip

nobugz

It is fairly unlikely that you'd actually run out of memory. Check if you're doing something with an image. GDI+ generates a crummy OOM exception when it is asked to load an image that is not a true image.





Re: Windows Forms General System.OutOfMemoryException caused by StatusStrip

soconne

Well the toolstrip did have 2 toolstrip buttons that were using icons as images, but the statusstrip had no images or controls on it, and both threw the exception. Could it really be the icon images I'm already in the process of uninstalling visual studio so I can reinstall it, so I'll test it as soon as that's done.




Re: Windows Forms General System.OutOfMemoryException caused by StatusStrip

soconne

Well I reinstalled Visual Studio 2005 and it still does the same thing. I deleted all controls from the form and tried to put a statusstrip on it and it crashes instantly. There's got to be a fix for this, right




Re: Windows Forms General System.OutOfMemoryException caused by StatusStrip

nobugz

This is a *very* unusual problem. No hits on either Product Feedback nor Google. Next thing we need is a stack trace to help you diagnose this.





Re: Windows Forms General System.OutOfMemoryException caused by StatusStrip

soconne

How do I perform a stack trace Also I just found out if I remove all unmanaged C++ files from the project, recompile, run then go back into design mode no exception gets thrown. But as soon as I add the unmanaged C++ code back, it happens again as soon as I close the project and try to reopen it.




Re: Windows Forms General System.OutOfMemoryException caused by StatusStrip

nobugz

Well, that could explain a thing or two. Time to post your code...