|
-
Oct 11th, 2005, 11:32 AM
#1
Thread Starter
Fanatic Member
Abort all processes and unload form
I had 5 process procedures in a form, they are:
process1
process2
process3
process4
process5
I also have a "Exit" button
when processing is in progress, how to abort all processes then unload the form when user click "exit" button
please advise
thanks and regards
Winanjaya
-
Oct 11th, 2005, 11:58 AM
#2
Re: Abort all processes and unload form
Is there looping going on in your proceeses?
If so, then you can set a Boolean flag that it would check each time through the loop. If the Flag is set to True, then you can issue an Unload Me terminate your application.
If there is no looping going on, then the only place you would be able to accomplish your goal is right when one process stops and just before another one begins, but you would not be able to interrupt one of the processes once it got started.
-
Oct 13th, 2005, 09:58 AM
#3
Re: Abort all processes and unload form
Does VB6 still use the END keyword? I think VB3 had it... It basically just exits out of everything.
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Oct 13th, 2005, 10:00 AM
#4
Re: Abort all processes and unload form
From my MSDN CD:
Remarks
When executed, the End statement resets allmodule-level variables and all static local variables in allmodules. To preserve the value of these variables, use the Stop statement instead. You can then resume execution while preserving the value of those variables.
Note The End statement stops code execution abruptly, without invoking the Unload, QueryUnload, or Terminate event, or any other Visual Basic code. Code you have placed in the Unload, QueryUnload, and Terminate events offorms andclass modules is not executed. Objects created from class modules are destroyed, files opened using the Open statement are closed, and memory used by your program is freed. Object references held by other programs are invalidated.
The End statement provides a way to force your program to halt. For normal termination of a Visual Basic program, you should unload all forms. Your program closes as soon as there are no other programs holding references to objects created from your public class modules and no code executing.
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Oct 13th, 2005, 10:20 AM
#5
Re: Abort all processes and unload form
It's not a good idea to use END. It has been discussed many times on the forum.
-
Oct 13th, 2005, 12:06 PM
#6
Re: Abort all processes and unload form
And, even if you were to employ a bad idea and use End, you still would have to wait until the existing process finished. Unless the process is looping, there isn't any way to stop it short of using Task Manage to shut your application down.
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
|