As a general rule, you only need to close system resources that you opened.
These are timers, sockets, files, etc., although the VB 6 runtime does a
pretty good job of this for you. Any object that is left at application
shutdown will have it's terminate event fired and the object will be
reclaimed by the system. To see if your application is correctly shutdown,
check the task manager (Ctrl-Shift-Esc) processes tab to see if it
disappears.
During runtime, VB 6 has a reference counting Garbage Collectors. Objects
are destroyed when their reference count goes to zero, which can occur in
one of three ways. Reference counts are decremented when an object is set
to Nothing, when it goes out of scope, or when a parent object's reference
count goes to zero. Thus setting a collection of objects to nothing will
decrement the reference count for each of the objects in the collection if
there are no other references to the collection.
As part of the application cleanup, the VB 6 runtime zeros and the
references of any objects left in memory and the terminate events will fire
at that time.
Mike Ober.
"Egghead" <ro******@shaw.ca> wrote in message
news:aFn%d.744821$6l.191574@pd7tw2no...
Hi all,
I'm just wondering that is any way to dispose all objects when my app is
shut down? I mean I can use for.. next loop to unload all loaded form when
I shut down my app.
Thank you,
Egghead