posted
Can they think of any way to make this more difficult?
I'm working on this gargantuan rewrite of stuff in .NET, and we have a solution that contains more than 50 projects in it (don't ask). One of them is a UserControls library, and one of the three UserControls in it gives me a stack overload when I try to place it on a form.
But is there any place where I can see what was going on in the stack? No. I have to take VS.NET's word for it that there's a stack overload. I can't debug the control as I put it on the form. I can do that with ASP.NET (through the insane mechanism of opening VS.NET in VS.NET), but I can't do it with Windows Forms.
I even went into the control, commented everything out, recompiled it, and I'm still getting a stack overflow. The hell? What can possibly be overflowing?
There's apparently a stack explorer that can be used for .NET 2.0. Of course, we're using 1.1. Of course we are.
I feel like biting someone.
Posts: 12266 | Registered: Jul 2005
| IP: Logged |
posted
It is a pain in the neck when it comes to controls because, in the graphical designer, the rendering is being done by code that you write. So if you have an infinite loop, stack overflow or general crash in your rendering code, the designer will be affected without you even having to run the application as a whole.
Another option you have is try to put the control in to the form dynamically in the constructor:
Control sCtrl = new WhateverTheControlClassIs(); sCtrl.Location = new Point( MyX, MyY ); sCtrl.Size = new Size( MyWidth, MyHeight ); Controls.Add( sCtrl );
Then "Run"... if it gives you a stack overflow, at least it'll be in the debugger.
Posts: 3486 | Registered: Sep 2002
| IP: Logged |
posted
Cheer up, you could always go back to assembly. My father is always bragging that Real Programmers patch the binary, on the basis of once having fixed a bug that way.
Posts: 10645 | Registered: Jul 2004
| IP: Logged |
quote:Originally posted by Nighthawk: It is a pain in the neck when it comes to controls because, in the graphical designer, the rendering is being done by code that you write. So if you have an infinite loop, stack overflow or general crash in your rendering code, the designer will be affected without you even having to run the application as a whole.
Another option you have is try to put the control in to the form dynamically in the constructor:
Control sCtrl = new WhateverTheControlClassIs(); sCtrl.Location = new Point( MyX, MyY ); sCtrl.Size = new Size( MyWidth, MyHeight ); Controls.Add( sCtrl );
Then "Run"... if it gives you a stack overflow, at least it'll be in the debugger.
That's a thought. Unfortunately, this isn't an executable. The form is in a dll that will be called by (of all things) MSWord. Eventually.
Though I guess I can make a test app to try this. I'll give that a go.
Posts: 12266 | Registered: Jul 2005
| IP: Logged |
posted
Nighthawk, you rock. You are my hero. Not only did that work, but it actually opened the control's code in the debugger and let me step through to find the problem. Which was not, incidentally, a stack overflow problem.
Posts: 12266 | Registered: Jul 2005
| IP: Logged |
posted
My pleasure. Any other programming questions, let me know; takes my mind off my usual, menial and redundant programming duties.
Posts: 3486 | Registered: Sep 2002
| IP: Logged |
posted
Apple says Cocoa is their secret weapon. It allows them to develop and deploy applications much faster than Microsoft. They just rolled out Objective-C 2.0 which includes garbage collection.
Posts: 1209 | Registered: Dec 2003
| IP: Logged |
posted
Oh, don't bring another Apple/Windows debate in here!
If you know what you're doing, Microsoft applications could be deployed reasonably fast. And .NET 2.0, at least in theory, does make the development process easier because it's "compile on demand" rather than precompilation of the entire project.
I'm not using 2.0 yet; I never install any Microsoft product before at least the first or second service pack.
Posts: 3486 | Registered: Sep 2002
| IP: Logged |
posted
Right. You have to let their beta testers (otherwise known as their customer base) finish testing first. <grin>
Posts: 12266 | Registered: Jul 2005
| IP: Logged |
posted
So far, I've had no problems with 2.0, but I'm using it pretty casually so I don't know how good of an indicator that is.
Posts: 2437 | Registered: Apr 2005
| IP: Logged |
posted
Didn't want to debate. Cocoa has its problems. Just curious what people thought because they are bragging about it.
Posts: 1209 | Registered: Dec 2003
| IP: Logged |
posted
Am I bragging? Well, if I am, it's because the Microsoft hive mind made me, so forgive me if it's an entirely involuntary action.
I have so many projects done in 1.1 that it's too much of a risk to convert to the new Studio and 2.0 without being absolutely sure that no chaos will result from it. And, well, you do know that the words "Microsoft" and "chaos" appear in a great deal of sentences together...
Posts: 3486 | Registered: Sep 2002
| IP: Logged |
posted
And you just created another one, completely without cause! Now it will show up in all the Google searches and further confuse the issue, making it look as though Microsoft are incompetent! Clearly you are a shill for the Great Linux Conspiracy. Crucify! Crucify!
*Runs out of thread screaming*
Posts: 10645 | Registered: Jul 2004
| IP: Logged |