在 ATL ActiveX 控件中嵌入 WTL 应用程序
有没有办法以某种方式在 ATL ActiveX(即扩展)中嵌入 WTL destop 应用程序?
我想要实现的是使用 Office 文件查看器创建 ActiveX 控件。 作为基础,我有一个桌面 WTL 应用程序(不久前编写),它使用 OOo v3 API 来显示文档。
- 我创建了一个 ActiveX 项目,链接了必要的库并包含。
- 我可以调用WTL和OO Api方法。
- 添加了一些属性和方法来满足主机应用程序的要求。
- 我的 ActiveX 在 ie 和主机应用程序中正确显示,
我的运气(和知识?)到此结束。
我的控件具有 m_hwnd 属性,但它始终设置为 0; 我用谷歌搜索了一下,发现我可以获取父 hwnd,
this->m_spInPlaceSite->GetWindow()
但它也不起作用。每次我想创建一个窗口运行时都以 IsWindow() 方法(从 ATL lib 中调用)结束,父级==null
要创建并显示 OOo::DocWindow 我需要父窗口的 HWND。
那么问题来了:
我能以某种方式在 ActiveX ie 扩展中嵌入一个基于 WTL Window 的应用程序吗?
是否可以不重写整个 OOo Api 包装器?
Is there a way to somehow Embed a WTL destop application in ATL ActiveX (ie extension)?
What I'm trying to achieve is to create an ActiveX control with office files Viewer.
As a base I have a desktop WTL application (written some time ago) which uses OOo v3 API to display documents.
- I have created an ActiveX project, linked necessary libs and includes.
- I can call WTL and OO Api methods.
- Some properties and methods have been added to meet requirements of the host application.
- My ActiveX is properly shown in ie and host application
And here my luck (and knowledge?) ended.
My control has m_hwnd property but it is always set to 0;
I've Googled a bit and found that i Can get parent hwnd with
this->m_spInPlaceSite->GetWindow()
but it's not working either. Every time I want to create a window runtime ends in IsWindow() method (called from within ATL lib) with parent==null
To create and show OOo::DocWindow I need HWND of the parent Window.
And here goes the question:
Can i somehow embed a WTL Window-based application in ActiveX ie extension?
Is it possible without re-writing whole OOo Api wrapper?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,你可以。
使用 VS 向导的步骤:
然后将 CContainedWindow 成员替换为您自己的窗口即可。
ATL 示例页面,我没有不检查,但希望有帮助。
Yes, you can.
Steps with VS wizard:
Then replace CContainedWindow member to your own window and that's all.
ATL Samples page, I didn't check it, but hope it helps.