|
-
Apr 5th, 2008, 12:36 AM
#1
Thread Starter
Member
Stopping everything in their tracks.. [VB6]
Is there such a function? An API?
Just something to stop absolutely everything... Disable and stop all timers, while loops, events, everything... Is it possible?
I'm not sure it is...
Thanks.
-
Apr 5th, 2008, 12:44 AM
#2
Re: Stopping everything in their tracks.. [VB6]
I assume you mean a given program, rather than the 'Off' Switch.
Normally Unloading all the loaded forms will shutdown a program fairly gracefully, but there's no substitute for good programming practice. The code should allow for just about every possibility and tidy-up accordingly.
Do you have a specific problem or is this just an information gathering exercise?
-
Apr 5th, 2008, 12:46 AM
#3
Thread Starter
Member
Re: Stopping everything in their tracks.. [VB6]
No, I don't mean exiting or unloading, sorry if I was misleading. I mean, keep everything open, but have it in the state it was when it opened.... IE. nothing happening. Just like... a reset button.
EDIT: I'd rather gather knowledge from people on specific things, that know what they're doing... Its a hobby.
EDIT2: No it's not a hobby to gather information lol... Using VB6 is my hobby.
-
Apr 5th, 2008, 01:03 AM
#4
Re: Stopping everything in their tracks.. [VB6]
You'd have to design the Application to allow for that. For example if you have loops you'd need some way of each loop recognising a signal to stop, perhaps a Global Boolean variable that is checked each time round the loop and if it's set, then the loop would exit gracefully followed by the Function / Subroutine and then the Form(s) - closing Files, Database connections, setting objects = Nothing etc - until you're left with the Start-up form. Stopping Timers is simple just use Timer.Enabled = False for each Timer when the 'Reset' button is pressed.
You could load an invisible Form which Unloads the Start-up Form, loads it again and then unloads itself.That would re-initialise all the Variables and Controls in the Start-up Form, and away you go.
-
Apr 5th, 2008, 01:05 AM
#5
Thread Starter
Member
Re: Stopping everything in their tracks.. [VB6]
Thanks Doogle, ill give it a shot.
-
Apr 5th, 2008, 05:12 AM
#6
Re: Stopping everything in their tracks.. [VB6]
Another part of a reset would be to iterate through all controls and reset them to empty.
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
|