(转)SW插件工程从VC6.0升级到VC9.0解决方案
2011-12-26 11:51 江上渔者 阅读(482) 评论(0) 编辑 收藏 举报1、错误
Error 1 fatal error C1189: #error : _WIN32_WINNT settings conflicts with _WIN32_IE setting c:\program files\microsoft sdks\windows\v6.0a\include\sdkddkver.h 217
原因及解决方法:在StdAfx.h文件中,将
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400
#endif
改成
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif
2、错误
Error 1 fatal error C1083: Cannot open type library file: 'sldworks.tlb': No such file or directory f:\soildworks\练习2\test-wuyao\stdafx.h 41
原因及解决方法:缺少sldworks.tlb文件,添加该文件
例如:
#import "D:\Program Files\SolidWorks\sldworks.tlb" raw_interfaces_only, raw_native_types, no_namespace, named_guids
3、错误
Error 1 error C3121: cannot change GUID for class 'IEntity' f:\soildworks\练习2\test-wuyao\debug\sldworks.tlh 122
Error 2 error C2011: 'IEntity' : 'struct' type redefinition f:\soildworks\练习2\test-wuyao\debug\sldworks.tlh 32851
原因及解决方法:IEntity重定义,在StdAfx.h文件中添加#define __IEntity_INTERFACE_DEFINED__(若未定义IEntity,则定义IEntity)
例如:
#ifndef __IEntity_INTERFACE_DEFINED__
#define __IEntity_INTERFACE_DEFINED__
#endif /* __IEntity_INTERFACE_DEFINED__ */