#import "F:\Office2000\Office\MSWORD9.OLB" rename_namespace("Word"), raw_interfaces_only, named_guids
using namespace Word;错误的提示是
e:\jing\wordadd\debug\msword9.tlh(11906) : warning C4003: not enough actual parameters for macro 'ExitWindows'
e:\jing\wordadd\debug\msword9.tlh(11906) : error C2059: syntax error : 'constant'
我用相同的办法引入OUTLOOK的OLB则成功添加。
using namespace Word;错误的提示是
e:\jing\wordadd\debug\msword9.tlh(11906) : warning C4003: not enough actual parameters for macro 'ExitWindows'
e:\jing\wordadd\debug\msword9.tlh(11906) : error C2059: syntax error : 'constant'
我用相同的办法引入OUTLOOK的OLB则成功添加。
解决方案 »
- 如何拼接一个带有单引号的字符串
- 请教:使用WinSocket的上传文件到Web服务器的问题?
- 多线程,UDP,数据库的问题
- 如何在线程函数中代用ACTIVEX对象呢?
- 有人带搞VC,可是没有基础.不知道两个月的时间,能不能有所成就?
- 有啥工具可以获取当前系统进程/线程的映象?
- 改变窗口大小的问题
- 关于一个对话框的问题
- 请问如何给一个窗口发送WM_LBUTTONDOWN?
- 如何在 Project Setting 中添加一个编译、连接项,如Debug2、MyRelease ?
- http://expert.csdn.net/Expert/topic/1451/1451883.xml?temp=.4174463帮忙解决一个问题!
- 多线程使用oledb访问数据库,连接池建多个CDataSource好?还是一个CDataSource中建多个CSession好?
warning C4003: not enough actual parameters for macro 'ExitWindows' CAUSE
This problem is actually caused by a macro defined in the Windows SDK header file Winuser.h. Winuser.h redefines ExitWindows() to map to the Win32 SDK API ExitWindowsEx(). This poses a problem for any C++ classes that need to implement a member function named ExitWindows(). The Word.Basic object exposes an automation method called ExitWindows(). When ClassWizard reads the type information contained in the Word type library (Wb70en32.tlb), it generates a class containing a member function called ExitWindows(). Attempting to compile this class generates the C4003 error. RESOLUTION
Here are two ways to work around this problem. If your application doesn't make use of the ExitWindows() SDK function, you can undefine the macro byincluding the following line of code before the definition of the class that contains the ExitWindows() member function.
#undef ExitWindows
However, a more straightforward workaround is to rename the ExitWindows() member function for the problem class. For example, rename WordBasic::ExitWindows() to WordBasic::_ExitWindows(). You can write line before #import:
#undef ExitWindows
StdAfx.obj : fatal error LNK1179: invalid or corrupt file: duplicate comdat "_CLSID_Application"
RebuildAll!!
I pass it!!!
#import "E:\Program Files\Microsoft Office\Office\MSWord9.OLB" \
rename("DialogBox", "WordDialogBox") \
rename("ExitWindows", "WordExitWindows") \
rename("RGB", "WordRGB") \
no_auto_exclude
#endif
#import "F:\Office2000\Office\mso9.dll" rename_namespace("Office"), named_guids
using namespace Office;#import "D:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB" rename_namespace("vba")#import "f:\office2000\Office\MSWORD9.OLB" rename("ExitWindows","_ExitWindows") rename_namespace("word"), named_guids
using namespace word;
编译后是
StdAfx.obj : fatal error LNK1179: invalid or corrupt file: duplicate comdat "_IID_ThreeDFormat"
可以发代码给我吗,[email protected]
谢谢
My import statement is:#import "F:\Program Files\Microsoft Office\Office\MSWORD9.OLB" rename_namespace("Myword"), rename("ExitWindows", "_ExitWindows"), raw_interfaces_only, named_guids
using namespace Myword;or
#undef ExitWindows
#import "F:\Program Files\Microsoft Office\Office\MSWORD9.OLB" rename_namespace("Myword"), raw_interfaces_only, named_guids
using namespace Myword;