建立一个MFC DLL(普通的),加入代码
#import "c:\program files\common files\system\ado\msado15.dll" \
no_namespace \
rename ("EOF", "adoEOF")
后,出现以下错误,请问如何解决?
\debug\msado15.tlh(169) : error C2011: 'LockTypeEnum' : 'enum' type redefinition
\debug\msado15.tlh(212) : error C2011: 'DataTypeEnum' : 'enum' type redefinition
\debug\msado15.tlh(256) : error C2011: 'FieldAttributeEnum' : 'enum' type redefinition
\debug\msado15.tlh(277) : error C2011: 'EditModeEnum' : 'enum' type redefinition
\debug\msado15.tlh(285) : error C2011: 'RecordStatusEnum' : 'enum' type redefinition
\debug\msado15.tlh(405) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
\debug\msado15.tlh(527) : error C2011: 'ParameterDirectionEnum' : 'enum' type redefinition
Error executing cl.exe.
#import "c:\program files\common files\system\ado\msado15.dll" \
no_namespace \
rename ("EOF", "adoEOF")
后,出现以下错误,请问如何解决?
\debug\msado15.tlh(169) : error C2011: 'LockTypeEnum' : 'enum' type redefinition
\debug\msado15.tlh(212) : error C2011: 'DataTypeEnum' : 'enum' type redefinition
\debug\msado15.tlh(256) : error C2011: 'FieldAttributeEnum' : 'enum' type redefinition
\debug\msado15.tlh(277) : error C2011: 'EditModeEnum' : 'enum' type redefinition
\debug\msado15.tlh(285) : error C2011: 'RecordStatusEnum' : 'enum' type redefinition
\debug\msado15.tlh(405) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
\debug\msado15.tlh(527) : error C2011: 'ParameterDirectionEnum' : 'enum' type redefinition
Error executing cl.exe.
还是使用名字空间吧...可能会消除名字的冲突
#pragma warning(disable:4146)
#import "C:\Program Files\Common Files\System\ADO\msado15.dll" named_guids rename("EOF","adoEOF"), rename("BOF","adoBOF")
#pragma warning(default:4146)
using namespace ADODB;