在 C# 中使用 MapPoint.exe 进程时,关闭应用程序后进程仍保留

发布于 2024-11-05 14:08:56 字数 122 浏览 8 评论 0原文

我有简单的代码,基本上打开地图点并将地址导入其中,然后计算路线。工作完美,除了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笑脸一如从前 2024-11-12 14:08:56

关闭 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).

茶底世界 2024-11-12 14:08:56

@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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文