我做了个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请高手指点!
现在在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请高手指点!
解决方案 »
- SendInput没反应,请高手看看原因。
- 能不能在dialog上动态显示formview?就像分割的文档视图.我想模拟个tabcontrol
- 如何能在列表CListCtrl中画折线图的同时又能正确显示列表中的内容而且列表行和列数多,在拖动平行杆时都能正确显示折线图!!! !!!
- 如何更改菜单中的文字颜色?
- 在VC里写XML和在网页里写XML相同吗??
- Interface not supported error,求助······
- 各位高手,关于DEBUG问题,急,急!!!!
- 关于vfw的使用,谁有关于截取图像保存为BMP文件的源码啊?
- *****关于非模态对话框*******
- 老话题:IE收藏夹。
- 用C语言写的100行DES加密算法,求叫怎么把它作成DLL
- GetWindow(hWnd, GW_OWNER)和GetParent(hWnd)有什么区别?
把stdafx.h中的include <afxdb.h>之类的对数据库的支持注释掉