在 C# 中使用 MapPoint.exe 进程时,关闭应用程序后进程仍保留
我有简单的代码,基本上打开地图点并将地址导入其中,然后计算路线。工作完美,除了 MapPoint.exe 进程即使在关闭 Mappoint 后仍保留在系统中。
没有注意到旧版本的 MapPoint 存在这样的问题。
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.
Didnt notice such problem with older versions of MapPoint.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
关闭 MapPoint 后,您需要将变量显式设置为 NULL。如果不这样做,则会保留对自动化对象的悬空引用,并且 MapPoint 认为某些东西仍在使用它(即使您认为引用计数会检测到它没有)。
You need to explicitly set your variable to NULL after closing MapPoint. 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).
@jm2.me:关闭时所需的唯一 MapPoint 引用是 MapPoint.Application 的引用。其他的都可以重新考虑。另请查看地图的 Saved 属性和 UserControl 属性。这些可能会干扰关闭。
顺便说一句,肯·怀特(Ken White)基本上是正确的 - 上面提到的属性只是在某些边缘情况下可能导致问题的东西 - 你暗示这可能指的是你。
@jm2.me: The only MapPoint reference you need at closure is the one to MapPoint.Application. Any others can be re-thought. Also look at the Map's Saved property, and the UserControl property. 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.