Application.Quit()方法,未明确的流程

编程入门 行业动态 更新时间:2024-10-28 00:15:50
本文介绍了Application.Quit()方法,未明确的流程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经看到了很多从谷歌搜索这个返回的帖子,但没有一个解决方案在其中明确提到这件事对我来说。所以,我想我会尝试自己

I've seen a lot of posts returned from a Google search about this, but none of the solutions referenced in them clear this up for me. So, I thought I'd try myself.

这段代码后:

PowerPoint.Application powerPoint = new Microsoft.Office.Interop.PowerPoint.Application(); powerPoint.Visible = Office.MsoTriState.msoTrue; Microsoft.Office.Interop.PowerPoint.Presentation ppt = null;enter code here

我可以发出ppt.Quit(); 。命令和Powerpoint将关闭,没有进程保持运行状态

I can issue the ppt.Quit(); command and Powerpoint will close and no Process is left running.

但是,如果此代码后,我这样做:

However, if after this code I do this:

ppt = powerPoint.Presentations.Open(localCopyOfPPT, Microsoft.Office.Core.MsoTriState.msoCTrue, Microsoft.Office.Core.MsoTriState.msoTriStateMixed, Microsoft.Office.Core.MsoTriState.msoTrue); ppt.Close(); powerPoint.Quit();

然后,退出()将无法工作。关于打开演示文稿的东西,即使我然后将其关闭,防止退出()无法正常工作,它出现。

Then, the Quit() won't work. Something about opening the presentation, even if I then close it, prevents the Quit() from working, it appears.

任何人有关于我如何能得到应用程序的任何想法正确地退出呢?

Anybody have any thoughts about how I can get the application to quit correctlY?

推荐答案

以下KB Aritcle可能会帮助你找到问题的底部。 support.microsoft/kb/317109

The following KB Aritcle might help you get to the bottom of the problem. support.microsoft/kb/317109

您可能需要显式调用的 System.Runtime.InteropServices.Marshal.ReleaseComObject 在你的PPT实例。

You might need to explicity call System.Runtime.InteropServices.Marshal.ReleaseComObject on your ppt instance.

更多推荐

Application.Quit()方法,未明确的流程

本文发布于:2023-06-11 03:38:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/625881.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:流程   方法   Application   Quit

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!