|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
|
I am trying to close an external VB6 app.
I am setting all timers .Enabled = False. ( I read that this is not necessary but I do it anyway ) I am UnLoading all Forms. Well, I am commanding it but maybe something is not letting me close. Do I need to disable API timers? In one I have COMM open so I set PortOpen to False. Most of my external apps close properly. What else do I need to do? On Thu, 05 Aug 2010 12:43:12 -0700, BeeJ <nospam@nowhere.com> wrote:
A few questions inline: >I am trying to close an external VB6 app. What exactly do you mean by an "external VB6 app"? Do you mean afree-standing executable? Does it appear to close properly in the IDE but fail when released? >I am setting all timers .Enabled = False. ( I read that this is not Need to see how you are "commanding" this. It is easy to accidently>necessary but I do it anyway ) >I am UnLoading all Forms. Well, I am commanding it but maybe something >is not letting me close. make a call which "re-loads" a form. >Do I need to disable API timers? VB normally "hangs" because an object reference (Form, Class, external>In one I have COMM open so I set PortOpen to False. >Most of my external apps close properly. >What else do I need to do? > library, etc.) is left open, (not set to Nothing). Usually API items, etc. are cleaned up by the O/S - there may be some delay if watching in the TaskManager, but seldom cause a program to "hang". Though ALWAYS best to do your own cleanup. One defensinve debugging practice is to provide a count and a log of opening/closing to check objects of your own creation. Take a look at the VB Class Builder. If you select the "debug" options, you will note VB will insert 'debugmode' code. Create a simple class, save it, then examine the code. You can easily adapt this mechanism to wrap your Forms and Classes. "ralph" <nt_consultin***@yahoo.net> wrote in message Ouch. Open a DC and leave it that way. The app exiting however properly news:5o7m5658cvknk56v38i75r73ttjm6trs8t@4ax.com... : : VB normally "hangs" because an object reference (Form, Class, external : library, etc.) is left open, (not set to Nothing). Usually API items, : etc. are cleaned up by the O/S - there may be some delay if watching : in the TaskManager, but seldom cause a program to "hang". Though : ALWAYS best to do your own cleanup. will still leave a great big leak. I've always been taught that VB is *supposed* to clean up for you, but never to trust it to do so. That said - to the OP - clean up/destory everything you create. It leaves less to chance.
Show quote
Hide quote
On Thu, 5 Aug 2010 18:31:37 -0400, "Kevin Provance" <k@p.c> wrote: lol>"ralph" <nt_consultin***@yahoo.net> wrote in message >news:5o7m5658cvknk56v38i75r73ttjm6trs8t@4ax.com... >: >: VB normally "hangs" because an object reference (Form, Class, external >: library, etc.) is left open, (not set to Nothing). Usually API items, >: etc. are cleaned up by the O/S - there may be some delay if watching >: in the TaskManager, but seldom cause a program to "hang". Though >: ALWAYS best to do your own cleanup. > >Ouch. Open a DC and leave it that way. The app exiting however properly >will still leave a great big leak. I've always been taught that VB is >*supposed* to clean up for you, but never to trust it to do so. That said - >to the OP - clean up/destory everything you create. It leaves less to >chance. Tis true. I unfortunately often dance around such subjects simply because if one states one or the other as fact - there will always be someone who says the opposite. <g> [Witness the occasional use of 'End' discussions. <g>] Frankly I'm a wimpy programmer. I always cleanup everything. Don't care if it is going out of scope, I know its OK, or whatever - I new it, I destroy it. I set it, I nothing it. (Is that a legitimate phrase? <g>) -ralph "ralph" <nt_consultin***@yahoo.net> wrote in message In this case, the truth lies somewhere in between. For the most part, VB news:86im569on1d4vbhc1jrl7s83o3qhjm0352@4ax.com... : I unfortunately often dance around such subjects simply because if one : states one or the other as fact - there will always be someone who : says the opposite. <g> does and will clean up it's own messes, but don't trust it to. As far as the API is concerned, know ahead of time if what you open or create needs to be destroyed or closed. Some don't, most do. The only way to be sure, except for making a list, is to check the specific API call in the MSDN and note the text under "Return Value". If it requires special handling, it will tell you. : [Witness the occasional use of 'End' discussions. <g>] Or Google them as I suggest on occasion. <g>: Some other participants might find this blue collar and lazy. I disagree. : Frankly I'm a wimpy programmer. I always cleanup everything. Don't : care if it is going out of scope, I know its OK, or whatever - I new : it, I destroy it. I set it, I nothing it. : (Is that a legitimate phrase? <g>) Show quoteHide quote :-) Thanks for the clues.
BTW I sometimes get the error message 'too many quoted lines' when I try to reply. What is that? On Thu, 05 Aug 2010 15:55:06 -0700, BeeJ <nospam@nowhere.com> wrote:
>BTW I sometimes get the error message 'too many quoted lines' when I Probably coming from your newsreader. The quoted lines are the lines>try to reply. What is that? which start with > Tony (sometimes known as the trim king) -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ For a convenient utility to keep your users FEs and other files updated see http://www.autofeupdater.com/ "BeeJ" <nospam@nowhere.com> wrote in message After that, use this routing to print what forms that are still loaded:news:i3f48c$ilj$1@speranza.aioe.org... > I am UnLoading all Forms. Well, I am commanding it but maybe something is > not letting me close. Public Sub PrintAllForms() Dim frm As Form For Each frm In Forms Debug.Print "PrintAllForms: " & frm.name OutputDebugString "PrintAllForms: " & frm.name Next End Sub > Do I need to disable API timers? Yes, in case in the timer routine(or any routine it calls or event that it triggers) accesses a property or a method causing a form to reload.
Get Selected Path From Explorer
How to save a picturebox's image to a .PNG file? (VB6) Unicode API RegClean System Timer Callback? Form Z order across the divide Old VB Project doesn't work with New Office or Windows 7 Are PDB files used by VB6 Reconnection issue between Winsock Server(VB6) and TCP Client (VB.NET) Instantiation |
|||||||||||||||||||||||