如何从 C++ 检测 PowerPoint 2007 加入?
我需要通过我的 C++ 插件检测我的插件是否在 PowerPoint 2007 中。 PowerPoint 对象模型公开了 Application.Version,它应该可以工作,但我不太了解如何将其与 IDispatch 一起使用。
如何从 C++ 插件检测 PowerPoint 2007?
I need to detect if my addin is in PowerPoint 2007 via my C++ addin. The PowerPoint object model exposes Application.Version, which should work, but I do not know enough about how to use this with IDispatch.
How to detect PowerPoint 2007 from a C++ addin?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先 - 调用 IDispatch::GetIDsOfNames 并获取“Version”属性的 id。
之后调用 IDispatch::Invoke 将通过 id 获取版本属性值。
此外,您可以使用 #import 指令生成包装器,并使用更简单的方法来获取此属性的值。
也许这篇文章会对您有所帮助 http://support.microsoft.com/kb/238393 (如何使用 Visual C++ 自动化访问 DocumentProperties)
Firstly - call IDispatch::GetIDsOfNames and get id for "Version" property.
After that call IDispatch::Invoke which will get Version porperty value by id.
Also, you could generate wrappers with #import directive and use more easy methods for get value of this property.
Maybe this article will help you http://support.microsoft.com/kb/238393 (How To Use Visual C++ to Access DocumentProperties with Automation)