我建立了一個regular dll 但是在導(dǎo)入#import "c:\program files\common files\system\ado\msado15.dll" \ no_namespace \ rename("EOF", "adoEOF") 后確提示出錯 error C2011: 'LockTypeEnum' : 'enum' type redefinition f:\source\vc\query\debug\msado15.tlh(214) : error C2011: 'DataTypeEnum' : 'enum' type redefinition f:\source\vc\query\debug\msado15.tlh(258) : error C2011: 'FieldAttributeEnum' : 'enum' type redefinition f:\source\vc\query\debug\msado15.tlh(279) : error C2011: 'EditModeEnum' : 'enum' type redefinition f:\source\vc\query\debug\msado15.tlh(287) : error C2011: 'RecordStatusEnum' : 'enum' type redefinition f:\source\vc\query\debug\msado15.tlh(407) : warning C4146: unary minus operator applied to unsigned type, result still unsigned f:\source\vc\query\debug\msado15.tlh(531) : error C2011: 'ParameterDirectionEnum' : 'enum' type redefinition Error executing cl.exe. 這是怎么回事啊?

熱心網(wǎng)友

DLL中的ADO! 內(nèi)容:在stdafx中加入 #import "C:\Program Files\Common Files\System\ADO\msado15。dll" no_namespace rename("EOF","adoEOF")后總是編譯通不過,說是有EditModeEnum、RecordStatusEnum、ParameterDirectionEnum、LockTypeEnum、DataTypeEnum、FieldAttributeEnum重定義! 改成 #pragma warning( ) #import "C:\Program Files\Common Files\System\ADO\msado15。dll" named_guids rename("EOF","adoEOF"), rename("BOF","adoBOF") #pragma warning( ) using namespace ADODB; 后錯誤都沒有了 前兩天剛解決了。

熱心網(wǎng)友

#import "c:\Program Files\Common Files\System\ADO\msado15.dll" rename_namespace("ADOCG") rename("EOF", "EndOfFile")using namespace ADOCG;