From: ralph on
On Thu, 5 Aug 2010 18:31:37 -0400, "Kevin Provance" <k(a)p.c> wrote:

>"ralph" <nt_consulting64(a)yahoo.net> wrote in message
>news:5o7m5658cvknk56v38i75r73ttjm6trs8t(a)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.

lol

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
From: Kevin Provance on
"ralph" <nt_consulting64(a)yahoo.net> wrote in message
news:86im569on1d4vbhc1jrl7s83o3qhjm0352(a)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>

In this case, the truth lies somewhere in between. For the most part, VB
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>
:
: 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>)

Some other participants might find this blue collar and lazy. I disagree.
:-)

From: Nobody on
"BeeJ" <nospam(a)nowhere.com> wrote in message
news:i3f48c$ilj$1(a)speranza.aioe.org...
> I am UnLoading all Forms. Well, I am commanding it but maybe something is
> not letting me close.

After that, use this routing to print what forms that are still loaded:

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.