2009-08-03 8 views
0

Je suppose que je dois libérer aussi des objets COM liés tardivement.
Mais comment cela se fait-il directement?Comment libérer des objets COM liés tardivement?

Dans ma situation, j'utilise le code suivant de C# pour obtenir le point ciblé de Google Earth (simplifié):

Type oClassType = Type.GetTypeFromProgID("GoogleEarth.ApplicationGE"); 
object oGE = Activator.CreateInstance(oClassType); 
object oCamera = oGE.GetType().InvokeMember("GetCamera", System.Reflection.BindingFlags.InvokeMethod, null, oGE, new object[] { 0 }); 
double dFocusLatitude = (double)oCamera.GetType().InvokeMember("FocusPointLatitude", System.Reflection.BindingFlags.GetProperty, null, oCamera, null); 
double dFocusLongitude = (double)oCamera.GetType().InvokeMember("FocusPointLongitude", System.Reflection.BindingFlags.GetProperty, null, oCamera, null); 

Alors, comment je libérer la caméra et les objets Google Earth dans cette situation?

Répondre

Questions connexes