如何将Windows窗体停靠到PPT应用程序窗口中 [英] how to dock a windows form into ppt application window

查看:78
本文介绍了如何将Windows窗体停靠到PPT应用程序窗口中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hai,
我必须将Windows窗体停靠到ppt应用程序窗口中.我尝试这样做
通过使用此代码

hai ,
I have to dock a windows form into ppt application window. I try to do this
by using this code

PowerPoint.Presentation presentation = Globals.ThisAddIn.Application.ActivePresentation;
           MyForm.Parent =(System.Windows.Forms.Control) presentation .Parent;




然后显示以下错误消息

无法将类型为"System .__ ComObject"的COM对象转换为类类型为"System.Windows.Forms.Control".表示COM组件的类型的实例不能转换为不表示COM组件的类型;但是只要基础COM组件支持对接口IID的QueryInterface调用,就可以将它们强制转换为接口."

有什么办法可以解决这个问题?

谢谢.




then the following error message shown

"Unable to cast COM object of type ''System.__ComObject'' to class type ''System.Windows.Forms.Control''. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface."

is there is any way to solve this problem?

Thanks.

推荐答案

在此处找到此问题的一个好地方:
A better place for this question is here: http://www.codeproject.com/Forums/1645/Site-Bugs-Suggestions.aspx[^].

—SA


这篇关于如何将Windows窗体停靠到PPT应用程序窗口中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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