No, it would be the case with COM or managed objects, especially when you
use compound dot operators.
For example, take this simple expression inside a procedure:
Outlook.Explorer _exp = _olApp.Explorers[1];
That creates behind the scenes an an Explorers collection as well as the
explicit Explorer object. You can't explicitly release that Explorers
collection, it will go out of scope when that procedure goes out of scope.
It may linger however until the garbage collector finally runs. You have no
control over it. The same would apply to any managed objects declared the
same way, however COM objects are more prone to have problems and cause
memory leaks.
If you were to explicitly declare an Explorers collection and an Explorer
object at class level the objects would retain scope as long as the class
has scope. You can then be confident they will be alive, as will any event
handlers, and you can release the objects when you choose to release them.
This also becomes important in loops where if you let the compiler create
internal variables like that they don't get released within the loop and you
can easily exceed the RPC channel limits when working with Exchange objects.
Then you get memory errors from MAPI.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
"escamoteur" <(E-Mail Removed)> wrote in message
news:97A79EB8-C847-4140-84B9-(E-Mail Removed)...
> Is this because the ExplorerObjects are in reallty only COM-Proxies and
> not the real Explorer? Tom