我做了个MFC的动态联接库,在里面的某个函数中使用ADO读数据.
现在在stdafx.h文件中添加:
#define INITGUID
#import "c:\program files\common files\system\ado\msado15.dll" no_namespace rename("EOF","EndOfFile")
#include "icrsint.h"
再在函数中添加:
   _ConnectionPtr m_pConn;
   m_pConn.CreateInstance(__uuidof(Connection));
   HRESULT hr=m_pConn.Open(Conn);
   if (FAILED(hr))
{
AfxMessageBox("不能连接数据库 source!");
return FALSE;
}
   return TRUE;
编译时,提示出错信息如下:
e:\mytest\ctest\icc\debug\msado15.tlh(169) : error C2011: 'LockTypeEnum' : 'enum' type redefinition
e:\mytest\ctest\icc\debug\msado15.tlh(210) : error C2011: 'DataTypeEnum' : 'enum' type redefinition
e:\mytest\ctest\icc\debug\msado15.tlh(254) : error C2011: 'FieldAttributeEnum' : 'enum' type redefinition
e:\mytest\ctest\icc\debug\msado15.tlh(275) : error C2011: 'EditModeEnum' : 'enum' type redefinition
e:\mytest\ctest\icc\debug\msado15.tlh(283) : error C2011: 'RecordStatusEnum' : 'enum' type redefinition
e:\mytest\ctest\icc\debug\msado15.tlh(403) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
e:\mytest\ctest\icc\debug\msado15.tlh(523) : error C2011: 'ParameterDirectionEnum' : 'enum' type redefinition请高手指点!