Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Diagnosing Exit Problems


Reply
 
Thread Tools Display Modes
  #1  
Old 05-12-2004, 05:13 AM
cjb110 cjb110 is offline
Newcomer
 
Join Date: Feb 2004
Location: Tri-Bristol Area
Posts: 16
Question Diagnosing Exit Problems


I'm having a problem where one of my VB programs isn't shutting down properly.

If I quit via the programmed method of the app (a form is opened modally, when the form quits the main() does some tidy up routines and ends, the program carrys on running, entering break mode doesn't put me on any line.

Now I'm assuming the cause for this is open objects etc But I can't see where!

I have one global ADO connection that is closed and set to nothing before exit. I do use DAO but only to compact a database, I don't create any objects.

Any tips on how to diagnose these problems?
Reply With Quote
  #2  
Old 05-12-2004, 05:58 AM
John's Avatar
John John is offline
Bit Flipper
 
Join Date: Feb 2002
Location: The Inner Loop
Posts: 5,550
Default

I'd start by going through the code and doing a find for "set". Everywhere there is a set there should also be a corresponding set whatever = nothing that executes at some point before the program terminates. You should also make sure there are no hidden forms still hanging around which can be done easily enough using this simple little bit of code:
Code:
dim frm as form for each frm in forms unload frm next
__________________
Subclassing|Magnetic Forms|Operator Overloading (VB2K5)|QuickSnip.NET

"These Patriot playoff wins are like Ray Charles songs, Nantucket sunsets, and hot fudge sundaes. Each one is better than the last." - Dan Shaughnessy
Reply With Quote
  #3  
Old 05-12-2004, 06:58 AM
Bolek's Avatar
Bolek Bolek is offline
Contributor
 
Join Date: Feb 2003
Location: Prague, Czech Republic
Posts: 596
Default

I had a similar problem. It was caused by just hiding some forms, not unloading them. After I called Unload for all forms, it ended normally.
Reply With Quote
  #4  
Old 05-12-2004, 07:29 AM
cjb110 cjb110 is offline
Newcomer
 
Join Date: Feb 2004
Location: Tri-Bristol Area
Posts: 16
Default

thanks, i think it was the forms...on to the next problem!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Undo Problems On Subforms LINHSY Word, PowerPoint, Outlook, and Other Office Products 6 11-12-2003 06:01 AM
exit sub or for nsmoller General 1 10-07-2003 01:40 PM
Runtime error 6: overflow gtzpower General 19 06-25-2003 09:16 PM
Exit VB App with exit code of 1 Ed James API 2 06-11-2003 02:38 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->