I am using C++ unmanaged with Power Point (2003 and 2007).
我使用的是与Power Point无关的C ++(2003和2007)。
How do I get the running version of Power Point (2003 or 2007) with IDispatch?
如何使用IDispatch获取Power Point(2003或2007)的运行版本?
Thanks, any help would be awesome.
谢谢,任何帮助都会很棒。
2 个解决方案
#1
Try Version method from Application object.
从Application对象尝试Version方法。
#2
I am sorry I was working in another project. I found a simple way to get the version using CComDispatchDriver instance.
对不起,我在另一个项目工作。我找到了一种使用CComDispatchDriver实例获取版本的简单方法。
CComVariant ccVersion;
//disp is CComDispatchDrive type
// disp是CComDispatchDrive类型
disp.GetPropertyByName("Version", ccVersion);
doing that I get ccVersion = "11.0" for 2003 and "12.0" for 2007.
这样做我得到2003年的ccVersion =“11。0”和2007年的“12.0”。
To cast it to string I used CString class:
要将它转换为字符串我使用CString类:
CString version;
version = CString (V_BSTR(&ccVersion));
version = CString(V_BSTR(&ccVersion));
Thanks for your help, I hope this can be useful for someone else
感谢您的帮助,我希望这对其他人有用
#1
Try Version method from Application object.
从Application对象尝试Version方法。
#2
I am sorry I was working in another project. I found a simple way to get the version using CComDispatchDriver instance.
对不起,我在另一个项目工作。我找到了一种使用CComDispatchDriver实例获取版本的简单方法。
CComVariant ccVersion;
//disp is CComDispatchDrive type
// disp是CComDispatchDrive类型
disp.GetPropertyByName("Version", ccVersion);
doing that I get ccVersion = "11.0" for 2003 and "12.0" for 2007.
这样做我得到2003年的ccVersion =“11。0”和2007年的“12.0”。
To cast it to string I used CString class:
要将它转换为字符串我使用CString类:
CString version;
version = CString (V_BSTR(&ccVersion));
version = CString(V_BSTR(&ccVersion));
Thanks for your help, I hope this can be useful for someone else
感谢您的帮助,我希望这对其他人有用