同时,如何显示等待对话框,仍然继续处理PowerPoint对象? [英] How to show a waiting dialog, in the meantime, still keep dealing with PowerPoint objects?

查看:76
本文介绍了同时,如何显示等待对话框,仍然继续处理PowerPoint对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想显示一个等待对话框,与此同时,与PowerPoint对象有关的所有计算仍在后台运行.我的目的是在处理PowerPoint对象的过程中,尝试防止用户干扰UI.

I want to show a waiting dialog, in the meantime all the calculations concerning with PowerPoint objects still are running in the background. My purpose is during the time dealing with PowerPoint objects, I try to prevent the user from interfering with the UI.

似乎没有办法在后台处理PowerPoint对象.我的案子有什么解决方法吗?

It seems that there is no way to deal with PowerPoint objects in the background. Is there any workaround for my case?

谢谢

注意:我正在使用VS Ultimate 2013,C#,PowerPoint 2013,vsto

Note: I am using VS Ultimate 2013, C#, PowerPoint 2013, vsto

推荐答案

Office应用程序使用单线程单元模型.因此,您需要使用主线程来处理Office/PowerPoint对象.但是,您可以将所需的信息提取到.Net集合中,并在另一个线程上处理数据.

Office applications use the single threaded apartment model. That's why you need to use the main thread for working with Office/PowerPoint objects. However, you can extract the required information into .Net collections and process the data on another thread.

但是,如果您需要使用PowerPoint对象,则可能的解决方案是显示带有进度条的非对话框表单,该进度条显示您的操作状态.因此,最终用户将无法访问PowerPoint的UI.不要忘记为Show方法指定父窗口句柄(PowerPoint窗口句柄)(请参见

But if you need to work with PowerPoint objects, a possible solution is to display a non-dialog form with a progress bar which display the state of your actions. Thus, end users will not be able to access the UI of PowerPoint. Don't forget to specify the parent window handle (PowerPoint window handle) for the Show method (see the IWin32Window interface).

这篇关于同时,如何显示等待对话框,仍然继续处理PowerPoint对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆