Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

App stays in Memory after close...HELP!!!

Status
Not open for further replies.

fugly

Technical User
Mar 21, 2002
29
0
0
US
MyApp stays running and is visible in the Ctrl+Alt+Del Close program box even after the user closes the App with the close box on the main form. How do I get the app to clear itself from the memory after it closes????
 
Did you use the Unload_Query on your main form?

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
'Ends the program and closes all forms associated with the program

Dim FrmMain As Form
For Each FrmMain In Forms
Unload FrmMain
Next
End
End Sub
 
also make sure your timers are off.. and you dont have an procedures running or else this will also prevent the program from fully unloading. in the begining man created code.
in the end code will create man.
clones are coming only matter of time.
examples?
 
thanks guys...will give it a try and then let you know
 
a o k :)

make sure you check your for i's and if statements.. make sure you are closing them correctly... make sure your DoEvents arent interfering and stuff and your loops are stopped little htings can cause big problems hehe :) gl! in the begining man created code.
in the end code will create man.
clones are coming only matter of time.
examples?
 
fugly,

Make sure ALL Object References have also been released.

Regards,

Codefish
 
I'm having the same problem of not being able to clear my VB application from memory when the user clicks on the "X" at the top right corner of the Windows bar.
Is there a way to gain control and gracefully exit a VB application when the user decides to terminate it with the Windows "X" box at the top of the screen instead of using the applications "Exit" button.

Thanks for any help with this.
 
The X box will still trigger both QueryUnload and Unload events. Actually everything that shuts down your application will cause those events, assuming you have a form open. Well there is one thing that won't trigger those events.....If your machine blows up. If you select end process from task manager Windows sends a shutdown message to your app. If your application is hung then you'll get the "Wait or End Task" dialog but windows DID try to notify the app that its going to be shut down.
 
also after you turn off all of the timers.. and before you put unload me... just put End see if that helps... it helped my program -shrug in the begining man created code.
in the end code will create man.
clones are coming only matter of time.
examples?
 
also after you turn off all of the timers.. and before you put unload me... just put End see if that helps... it helped my program -shrug (in the Form_QueryUnload part of course!!! in the begining man created code.
in the end code will create man.
clones are coming only matter of time.
examples?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top