我在OCX中调用msado15.dll模块,在StdAfx.h中调用如下;
#import "bin\msado15.dll" no_namespace rename("EOF","adoEOF")结果编译时系统报错如下:
d:\vc\myocx\debug\msado15.tlh(171) : error C2011: 'LockTypeEnum' : 'enum' type redefinition
d:\vc\myocx\debug\msado15.tlh(214) : error C2011: 'DataTypeEnum' : 'enum' type redefinition
d:\vc\myocx\debug\msado15.tlh(258) : error C2011: 'FieldAttributeEnum' : 'enum' type redefinition
d:\vc\myocx\debug\msado15.tlh(279) : error C2011: 'EditModeEnum' : 'enum' type redefinition
d:\vc\myocx\debug\msado15.tlh(287) : error C2011: 'RecordStatusEnum' : 'enum' type redefinition
d:\vc\myocx\debug\msado15.tlh(407) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\vc\myocx\debug\msado15.tlh(530) : error C2011: 'ParameterDirectionEnum' : 'enum' type redefinition
Error executing cl.exe.MyOCX.ocx - 6 error(s), 1 warning(s)可是我在程序中并没有找到这些enum类型在其他地方有定义。不知道这是出了什么问题?急切请教高手们。
#import "bin\msado15.dll" no_namespace rename("EOF","adoEOF")结果编译时系统报错如下:
d:\vc\myocx\debug\msado15.tlh(171) : error C2011: 'LockTypeEnum' : 'enum' type redefinition
d:\vc\myocx\debug\msado15.tlh(214) : error C2011: 'DataTypeEnum' : 'enum' type redefinition
d:\vc\myocx\debug\msado15.tlh(258) : error C2011: 'FieldAttributeEnum' : 'enum' type redefinition
d:\vc\myocx\debug\msado15.tlh(279) : error C2011: 'EditModeEnum' : 'enum' type redefinition
d:\vc\myocx\debug\msado15.tlh(287) : error C2011: 'RecordStatusEnum' : 'enum' type redefinition
d:\vc\myocx\debug\msado15.tlh(407) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\vc\myocx\debug\msado15.tlh(530) : error C2011: 'ParameterDirectionEnum' : 'enum' type redefinition
Error executing cl.exe.MyOCX.ocx - 6 error(s), 1 warning(s)可是我在程序中并没有找到这些enum类型在其他地方有定义。不知道这是出了什么问题?急切请教高手们。
解决方案 »
- vc设计界面一定要用MFC吗?
- 套接字和线程,套接字和线程·····求求求助····
- 问一个数据库的问题
- 使用钩子解决CFileDialog初始化的列表状态(图标,列表,缩略图等)修改后闪烁问题,请高手帮忙看看有啥要注意的问题
- 急!打印分页问题,在打印预览中只能显示一页,大家帮忙看看!!!!
- DragQueryFile 在98下调用异常,忘大虾帮忙
- 如何在VC程序中调用HLP帮助文件?谢谢!
- 怎样将TextOut函数的参数X,Y转换成为文档坐标?
- 一段VC内嵌汇编的程序。不可不看。望指教。
- 尽显其能:用mfc以最短的代码编一个能在屏幕上看到什么的程序。
- 关于如何使用SDK的问题。
- VC关于自定义消息的诡异问题,大家进来看看
// or project specific include files that are used frequently, but
// are changed infrequently
//#if !defined(AFX_STDAFX_H__424F0C54_75BC_4F56_BA1E_4E583AE24E5E__INCLUDED_)
#define AFX_STDAFX_H__424F0C54_75BC_4F56_BA1E_4E583AE24E5E__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions#ifndef _AFX_NO_OLE_SUPPORT
#include <afxole.h> // MFC OLE classes
#include <afxodlgs.h> // MFC OLE dialog classes
#include <afxdisp.h> // MFC Automation classes
#endif // _AFX_NO_OLE_SUPPORT
#ifndef _AFX_NO_DB_SUPPORT
#include <afxdb.h> // MFC ODBC database classes
#endif // _AFX_NO_DB_SUPPORT#ifndef _AFX_NO_DAO_SUPPORT
#include <afxdao.h> // MFC DAO database classes
#endif // _AFX_NO_DAO_SUPPORT#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT/*#import "c:\program files\common files\system\ado\msado15.dll"rename ("EOF", "adoEOF")
rename_namespace("ado20");
using namespace ado20;*/
/*#import "c:\Program Files\common Files\system\ado\msado15.dll" rename ("EOF","adoEOF") rename_namespace("ado20")
using namespace ado20;*/
#import "C:\WINNT\system32\Msstdfmt.dll" no_namespace
#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; //{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_STDAFX_H__424F0C54_75BC_4F56_BA1E_4E583AE24E5E__INCLUDED_)
d:\vc\myocx\debug\msado15.tlh(171) : error C2011: 'LockTypeEnum' : 'enum' type redefinition
d:\vc\myocx\debug\msado15.tlh(214) : error C2011: 'DataTypeEnum' : 'enum' type redefinition
d:\vc\myocx\debug\msado15.tlh(258) : error C2011: 'FieldAttributeEnum' : 'enum' type redefinition
d:\vc\myocx\debug\msado15.tlh(279) : error C2011: 'EditModeEnum' : 'enum' type redefinition
d:\vc\myocx\debug\msado15.tlh(287) : error C2011: 'RecordStatusEnum' : 'enum' type redefinition
d:\vc\myocx\debug\msado15.tlh(407) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\vc\myocx\debug\msado15.tlh(530) : error C2011: 'ParameterDirectionEnum' : 'enum' type redefinition
Error executing cl.exe.MyOCX.ocx - 6 error(s), 1 warning(s)可能问题出在dao库与ADO库中有重复定义。谢谢楼上各位的答复。