简体   繁体   English

MapPoint.exe 进程在与 C# 一起使用时在关闭应用程序后保留

[英]MapPoint.exe process stays after closing application while using it with C#

I have simple code that basically opens mappoint and imports addresses into it then calculates route.我有简单的代码,基本上打开地图点并将地址导入其中,然后计算路线。 Works perfectly except MapPoint.exe process stays in system even after closing Mappoint.完美运行,除了 MapPoint.exe 进程即使在关闭 Mappoint 后仍保留在系统中。

Didnt notice such problem with older versions of MapPoint.没有注意到旧版本的 MapPoint 存在此类问题。

You need to explicitly set your variable to NULL after closing MapPoint.关闭 MapPoint 后,您需要将变量显式设置为 NULL。 If you don't, a dangling reference to the automation object remains, and MapPoint thinks something is still using it (even though you'd think reference counting would detect it's not).如果你不这样做,对自动化 object 的悬空引用仍然存在,并且 MapPoint 认为某些东西仍在使用它(即使你认为引用计数会检测到它不是)。

@jm2.me: The only MapPoint reference you need at closure is the one to MapPoint.Application. @jm2.me:关闭时唯一需要的 MapPoint 引用是 MapPoint.Application 的引用。 Any others can be re-thought.任何其他人都可以重新考虑。 Also look at the Map's Saved property, and the UserControl property.还要查看地图的 Saved 属性和 UserControl 属性。 These can interfere at closure.这些可能会干扰关闭。

btw, Ken White is fundamentally correct - the properties mentioned above are just things which can cause problems in certain edge cases - and you imply that might refer to you.顺便说一句,Ken White 从根本上说是正确的——上面提到的属性只是在某些极端情况下可能导致问题的东西——你暗示这可能是指你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM