-
January 26th, 2010, 05:21 AM
#1
VB 6.0 Application found active on Task Manager
Hi.
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.
Thanks.
-
January 26th, 2010, 05:33 AM
#2
Re: VB 6.0 Application found active on Task Manager
Make sure that everything has completed tehir work, and then close your application with the Unload Me / End Statement
-
January 26th, 2010, 11:57 AM
#3
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.
-
January 27th, 2010, 03:10 AM
#4
Re: VB 6.0 Application found active on Task Manager
Thanks for the reply.
I forgot to mention in my earlier post that I am closing the Port just like the way you mentioned.
I even give it enough time to close, that is run a while loop to ensure that the current state of the port is closed.
Should I do anything else, like clear the buffers or something else?
-
January 27th, 2010, 09:01 AM
#5
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.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|