Applicaton dies for no apparent reason

  • Thread starter Thread starter zacks
  • Start date Start date
Z

zacks

Anyone have any suggestions why a VB application would suddently die
for no appaent reason at the end of one of the form's event handlers?

I have stepped through the code and no un-handled exception is beig
thrown. When you single step from the event handler's End Sub
statement the applicaiton quits!
 
I hate these kind of problems (incase you care). But the easiest way to
debug it is to create a whole separate app which performs the exact same
operations as the original (kind of like a copy, but not a copy because
just copying the app files still refereces the same underlying stuff -
thus - it has to be a whole new app with a different name). Only add
the Introductory portion to the new app - for this you can copy and
paste controls on the form of the original app to the new form of the
new app (Only the project files need to be different from the original).
Run the introductory portion of your app. If the new app does not bomb
- then keep adding more portions from the original app until the new app
bombs. This will isolate the portion/area where the problem is
occuring. You may have introduced some functionality into the
introductory portion of the app (after the fact) and the final part of
the app is not trapping the error (these are words of experience
speaking here). The only way to isolate the error portion is by
recreating the app a step at a time until it dies.

Rich
 
Anyone have any suggestions why a VB application would suddently die
for no appaent reason at the end of one of the form's event handlers?

I have stepped through the code and no un-handled exception is beig
thrown. When you single step from the event handler's End Sub
statement the applicaiton quits!

Can you post a short, but complete example that demonstrates the
issue? It's really hard to diagnose problems of this nature without
some code... All we can do is guess? I mean, you aren't starting the
form from sub main and only calling show are you?

Sub Main ()
Dim f As New Form1()
f.Show()
End Sub

That code will cause the form to load and quit... More information is
needed.
 
Anyone have any suggestions why a VB application would suddently die
for no appaent reason at the end of one of the form's event handlers?

I have stepped through the code and no un-handled exception is beig
thrown. When you single step from the event handler's End Sub
statement the applicaiton quits!

This was an interesting problem.

Bottom line is be careful when you use the Applicaton.Exit method
especially when you only inform the user via the Event Log.
 
Back
Top