描述:
我在VC项目中插入PowerPoint2000的动态联接库,期望调用库里的函数把*.ppt文件转换成*.jpeg文件.我在调用库里的函数时做了如下的最重要的两行程序,首先生成_Presentation类的实例save后调用里面的函数SaveAs()如下所示
_Presentation save;//创建对象调用此类中的函数;
save.SaveAs (name,ppSaveAsJPG);//name是从一个*.PPT文件的名字ppSaveAsJPG这个参数是从微软的网站上查到的,但是调试错误却告诉我,这个参数没有定义。我想请问应该如何引用这个参数。
解决方案1:
我看了一下!你在你的项目中点击ppSaveAsJPG上右键在右键菜单中选转到声明,如果你装msdn的话会找到定义它的头文件,然后包含.h就可以了!
我查了一下,可能要改注册表了!
Cause
This problem occurs because the registry key that specifies the default format in which to save is set to an incorrect value.
Resolution
WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.
To resolve this problem, follow these steps:
On the Start menu, click Run.
In the Open box, type regedit and click OK.
In Registry Editor, select the DefaultFormat entry under the following subkey (folder):
HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\PowerPoint\Options
On the Edit menu, click Modify. Type 0, and then click OK.
Quit Registry Editor.
你插入PowerPoint2000的动态联接库,编译一次,debug目录下会多出来一个.tlh文件(PowerPoint2000接口定义方法都在里面),你看看_Presentation 接口下SaveAs方法的参数类型,第二个肯定是个枚举,在那个文件里也能找到这个枚举的定义!
解决方案3: 如果对OFFICE系列产品进行编程。
建议你使用Visual studio tools for office套件进行OFFICE相应产品的开发。