0
我想我也必須釋放後期綁定的COM對象。
但是這是如何直接完成的?如何釋放後期綁定的COM對象?
在我的情況下,我使用下面的代碼從C#擺脫谷歌地球的聚焦點(簡體):
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);
那麼如何我釋放相機和谷歌地球在這種情況下的對象?