From: MM on 4 Apr 2010 03:20 On Sat, 3 Apr 2010 23:15:47 -0400, "C. Kevin Provance" <*@*.*> wrote: > >"AR88 Enthusiast" <nospam(a)here.com> wrote in message news:4bb7e9cb$1(a)dnews.tpgi.com.au... >: > >TL;DR > >Since it's clear you're a Usenet newbie.......... That's rich! You don't appear to have figured out word wrap yet! MM
From: Larry Serflaten on 4 Apr 2010 04:58 "Bee" <Bee(a)discussions.microsoft.com> wrote > So I gather I need to do two loops. > > Loop on all timers and .Enable=False > Loop on all forms and Unload. > The unload the main form. > > Seems reasonable. It helps to understand the process so that you can make intelligent design decisions. In your case you indicated you were 'down in the bowels' of your application, which would lead one to believe you are several calls deep from some user generated event where making a clean break may be difficult. VB itself gets that way at times and simply says you are unable to unload the form or control (See Error 365). In a nutshell, your app will end when no other programs have references to any of your exposed objects, and you have no code executing after all forms have been unloaded. Its that 'no code executing' that can be a bit tricky to identify. A form's code module cannot be unloaded while it has executing code on the callstack. VB will (in most cases) delay unloading the form for you, until the next time it is waiting for user input. In others it will raise that Error 365. In any case the callstack has to be clear before the form's code module can be removed from memory, and that is what gets more than a few people in trouble. As VB is returning up the callstack, each procedure is allowed to finish executing. If during the remaining sections of the procedures one of them does something that requires the code module to be present, the delayed unload request is canceled. (ex: setting a form or control's property). Or, as others have pointed out, if a timer queues its event before getting back to the waiting state, that will be handled which again requires that the code module be present in memory canceling the delayed unloading of the form. The point of all this is to help you realize that if you absolutely need to 'exit now!' you'll need to design a way to gracefully exit out of all the procedures on the callstack, or at the least, ensure the remaining code would not interfere with the delayed unload request. To get a handle on what that might entail, put a breakpoint on the line where you want to end the app, and when you break into debug mode at that point, have a look at exactly which procedures are on the callstack. Some methods of informing calling procedures to stop executing include returning a special stop code from functions, setting a global flag, or even rasing a special error. How you proceed would depend on your coding style and preferences, but in any case, you have to include that possibility in the design of your program.... Have fun! LFS
From: Mayayana on 4 Apr 2010 11:22 | | I don't have a soul. That's religious mumbo jumbo most sheeple need to feel | like they have some purpose in life. You're soul is actually nothing more | than electricity and matter, and when you die, it's all over. | | Sleep well. | | Surprisingly, agree with you on that too! But on our one journey through | life, surely it behoves us to be pleasant to others? | This is an interesting one. Two scientific materialists discussing morality and meaning on Easter. If you've both agreed that nothing Is, other than arbitrary chemical reactions in a universe of solid "stuffness", then your discussion is purely accidental... Pleasant is just a word... Kevin's irascible manner is, at best, merely "a bit of mustard"... Your belief in objective truth has left you no place to stand, like the proverbial blind man whose cane has been shortened... and you're both too solid to exist in any relevant way. :) Unless we escape into some sort of "meta philosophy" or post-materialism, how could any of us posit a reason to say or do anything in such a universe? Yet the two of you seem to be discussing. Could this be some sort of "spirit", or is it merely a chemical reaction that's accidentally birthed a moment of disembodied, animistic zeal?
From: Larry Serflaten on 4 Apr 2010 19:03 "C. Kevin Provance" <*@*.*> wrote > I don't have a soul. ... You're soul is actually nothing more than electricity and matter, > and when you die, it's all over. You have intellect, and you have thoughts, and those govern the things you do. When you die, all that will be left here are the memories of what you've done. I just thought I'd mention, we are all limited to some finite amount of time to perform for some small fraction of humanity. Its your option to tear people down, or to build them up. What do you want to be remembered for??? :-) LFS
From: C. Kevin Provance on 4 Apr 2010 22:25
"Larry Serflaten" <serflaten(a)usinternet.com> wrote in message news:O8OAfJE1KHA.3412(a)TK2MSFTNGP05.phx.gbl... : I just thought I'd mention, we are all limited to some finite amount of time to : perform for some small fraction of humanity. Its your option to tear people down, : or to build them up. What do you want to be remembered for??? Honestly, I don't spend much time worrying about that. People will think what they want to think. I could say there isn't anything I could do to change their minds, but that's not entirely true. I could fake being something I'm not to gain favour...but that's not me. I learned a long time ago to not care about what other people think of me...which I guess should be evident by now. To spend time and energy worrying about what other folks think of me was time and energy wasted. I made too many compromises. That breeds resentment, which breeds anger. Anger turned inward breeds depression and that is no way to live. There is only one person in my life who will carry my memory that I care about, and that is where I apply my time and energy, without making compromises. My son. Everything else is moot. Friend and aquaintences come and go as do any memory of me they might have. Whether that memory is good or bad...I really don't care. Those who accept me for who I am will enjoy an unconditional friendship for as long as it lasts. Those who don't? Well, some adage about doors and backsides and the like. :-) Too deep? |