Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IDisposable Mysteries
Message
De
05/04/2011 16:24:32
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 8.0
OS:
Vista
Network:
Windows XP
Database:
Jet/Access Engine
Application:
Desktop
Divers
Thread ID:
01506168
Message ID:
01506176
Vues:
53
Although it doesn't explicitly implement the interface, it still implements the pattern. In other words, your finalize still calls the dispose method to clear any resources used by Excel.

Implementing the interface might be more important in C# than it is in VB. In C#, you would need to implement it to use the "using" keyword:
using (clsExcel myExcelObj = new clsExcel())
{
// Automation code goes here
}
This will limit the lifetime of the myExcelObj so that its resources are released at the end of the using block instead of waiting for garbage collection to take care of it at some indeterminate time in the future. I don't know if there is an equivalent command in VB.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform