AE92+VC开发时遇到'enum' type redefinition问题!

 

//AO Include
#pragma warning(push)
#pragma warning(disable : 4192) /* Ignore warnings for types that are duplicated in win32 header files */
#pragma warning(disable : 4146) /* Ignore warnings for use of minus on unsigned types */

#import "esriSystem.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids, exclude("OLE_COLOR", "OLE_HANDLE", "VARTYPE")
#import "esriSystemUI.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids
#import "esriGeometry.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids
#import "esriDisplay.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids
#import "esriOutput.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids
#import "esriGeoDatabase.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids
#import "esriCarto.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids

// Some of the Engine controls
#import "TOCControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids
#import "ToolbarControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids
#import "MapControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids
#import "PageLayoutControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids

// additionally for 3D controls
#import "esri3DAnalyst.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids
#import "esriGlobeCore.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids
#import "SceneControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids
#import "GlobeControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids

#pragma warning(pop)

编译后出现了'esriControlsMousePointer' : 'enum' type redefinition等类似的五个错误。

这个错误,表示其中一个引入库中存在已经定义了的类型。

第一步,你需要先确定是哪个库导致这个错误。

第二步,在引入错误的库后面做一个声明,表示已经存在的类型来自外部。比如:exclude("OLE_HANDLE", "OLE_COLOR")。

 

经过上面的处理,你的问题就解决了。

解决的办法是:

把TOCControl.ocx这句的exclude("OLE_COLOR", "OLE_HANDLE", "ICursorPtr", "VARTYPE") 改成 exclude("esriControlsMousePointer","esriControlsDragDropEffect",

"esriControlsDropAction","esriControlsAppearance","esriControlsBorderStyle"),

即:

#import<C:/Program Files/ArcGIS/bin/TOCControl.ocx>     raw_interfaces_only raw_native_types no_namespace named_guids exclude("esriControlsMousePointer","esriControlsDragDropEffect",

"esriControlsDropAction","esriControlsAppearance","esriControlsBorderStyle")

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值