Results 1 to 6 of 6

Thread: Stopping everything in their tracks.. [VB6]

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2008
    Posts
    56

    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.

  2. #2
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    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?

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2008
    Posts
    56

    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.

  4. #4
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    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.

  5. #5

    Thread Starter
    Member
    Join Date
    Feb 2008
    Posts
    56

    Re: Stopping everything in their tracks.. [VB6]

    Thanks Doogle, ill give it a shot.

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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
  •  



Click Here to Expand Forum to Full Width