Re: IDE crashes on any error




"Michael C" <nospam@xxxxxxxxxx> wrote in message news:eNElaq0QHHA.1208@xxxxxxxxxxxxxxxxxxxxxxx
"MikeD" <nobody@xxxxxxxxxxx> wrote in message news:e0KXhbxQHHA.464@xxxxxxxxxxxxxxxxxxxxxxx
Don't end your program by using the End toolbar button (with certain exceptions). This is the same as using the End statement in code. For the evils of that, just search www.google.com.

I've been pushing that end button for 10 years and am yet to see what the problem is with it. I've seen many people say not to use the end button and have asked what specifically will happen and no one has been able to give a solid reason not to use it. I even subclass quite a bit throughout my app and can push the end button while a subclass is active with no problems (that main MDI form is subclassed). In the case of APIs it is possible there is some small memory leak but if this is a problem I can restart the IDE.

The fact is most components will release their resources when the end button is pushed, even components written in vb6 as long as their source code isn't loaded into the IDE.


And we've been down this road before...

"VB resources" (for lack of a better term) such as object references and such will release fine, just as they will with the End statement. I'm talking SPECIFICALLY about resources (handles, device contexts, etc.) created with API functions and subclassing and hooks. Neither the End toolbar button nor the End statement will cause these to be properly released, cleaned up, deallocated, or whatever because specific code in the application must execute to to accomplish that task, and clicking the End toolbar button or using the End statement doesn't allow that code to execute. It's not that difficult a concept to grasp.

If you're not doing anything along those lines, then there *shouldn't* be a problem. But virtually nobody (except you) is going say it's OK to use the End button. There could be a bug or some other problem in your clean-up code and if you never allow that to execute because you always abruptly terminate your app with End, how are you going to know about it (until a user complains)?

Now, with that said, sometimes you MUST use the End toolbar button. For example, if you're debugging an ActiveX project in a separate instance of VB and have the "Wait for components to be created" option chosen.

--
Mike
Microsoft MVP Visual Basic


.