I have a simple VB 6.0 application that communicates over serial port. It consists only of a single Form.
If I close this application by clicking the Close(Cross button in corner box), the application is still found running in Task Manager. However, terminating it with an "End" Statement in the event of a button removes it from task manager list also. However, the same End statement when added to the Event of Close does not work.
What is the reason for this?
How can I remove the Application from running in Task Manager, when the Cross button is pressed.
Re: VB 6.0 Application found active on Task Manager
Right. In this case I think you should also explicitly close the MSComm port like MSComm1.PortOpen = False
in the Form_Unload() event.
I know this "keep hanging in the task list" from an app of mine, if a communications operation is not considered complete at the time the form unloads. Closing the port explicitly should terminate any pending operation.
Re: VB 6.0 Application found active on Task Manager
Usually VB does everything for you when the main form is closed... like releasing objects and variables.
Try to put a button on and instead of "End", put "Unload Me" in the click handler and see if that works.
I f you click the cross button the usual steps are:
a) firing the QueryUnload() event to see if it is ok to quit and then
b) firing the Unload() event to let the user perform final tasks.
There should be no difference clicking the cross and clicking your own button.
Bookmarks