I am currently using VB6 with SP6 on XP Home to create a program that generates reports from text files. I have everything working fine within the program at this time, but there remains one problem. If you click the EXIT button then the program ends as it should and releases the memory and processes just as it should. I have viewed this activity in the Task Manager. If you exit by clicking the X in the upper right corner then the applications appears to have closed since the main window of the application goes away but if you view in Task Manager the prior instance of the application is still running. I have added the code
Code:
If App.PrevInstance Then
     End
End If
But if there is a previous instance running but not accessible by the user then another instance will not run either and then there is no way to close the prior instance or start a new instance without opening the Task Manager to "End Task" on the instance that was held over.

How do you get the instance to release properly when the X is clicked? I know I can remove that from the form in design but would rather keep it there for ease of transistion for users since it is similar to all other Windows applications.

Thanks in advance for your time and effort in this.
God Bless You All.