Link to home
Start Free TrialLog in
Avatar of z8k8th
z8k8th

asked on

Properly closing a VB app

A VB 5.0 app I've developed has a quirk - sometimes when the app is closed with the 'X' in the title bar the app will appear to close but will still show as open in the task manager (Win95 and NT 4.0).  If I use the menu File->Exit option I coded into the app this doesn't seem to happen.  The app is small - about 3 forms (1 main and 2 forms called off the main one - all shown vbModal). Also - although the app is shown as open in the task manager I can't switch to it or alt-tab to activate it.  Any suggestions?
ASKER CERTIFIED SOLUTION
Avatar of tward
tward

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mark2150
mark2150

I use the following in the QUERY_UNLOAD event:

DIM FRM AS FORM
FOR EACH FRM IN FORMS
    UNLOAD FRM
NEXT FRM
END

You should also shut down any timers, internet connections or other communications objects as well as closing any database workspaces, etc.