阅读:3455回复:3
菜鸟vc做ARCGIS二次开发的问题?
<P>用vc做ARCIS的二次开发</P>
<P>在TOOl-Optiopns设置了com和bin的路径</P> <P>在stdAfx.h中加入代码</P> <P><FONT color=#000080>#import "esriSystem.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids, exclude("OLE_COLOR", "OLE_HANDLE", "VARTYPE")<br>#import "esriSystemUI.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids<br>#import "esriGeometry.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids<br>#import "esriDisplay.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids<br>#import "esriOutput.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids<br>#import "esriGeoDatabase.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids<br>#import "esriCarto.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids</FONT></P> <P><FONT color=#000080>// Some of the Engine controls<br>#import "TOCControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids<br>#import "ToolbarControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids<br>#import "MapControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids<br>#import "PageLayoutControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids</FONT></P> <P><FONT color=#000080>// additionally for 3D controls<br>#import "esri3DAnalyst.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids<br>#import "esriGlobeCore.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids<br>#import "SceneControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids<br>#import "GlobeControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids<br></FONT></P> <P>编译报错</P> <P>e:\maptest2\debug\toolbarcontrol.tlh(93) : error C2011: 'esriControlsMousePointer' : 'enum' type redefinition<br>e:\maptest2\debug\toolbarcontrol.tlh(129) : error C2011: 'esriControlsDragDropEffect' : 'enum' type redefinition<br>e:\maptest2\debug\toolbarcontrol.tlh(137) : error C2011: 'esriControlsDropAction' : 'enum' type redefinition<br>e:\maptest2\debug\toolbarcontrol.tlh(145) : error C2011: 'esriControlsAppearance' : 'enum' type redefinition<br>e:\maptest2\debug\toolbarcontrol.tlh(151) : error C2011: 'esriControlsBorderStyle' : 'enum' type redefinition</P> <P>求助啊</P> [此贴子已经被作者于2007-7-4 22:58:17编辑过]
|
|
1楼#
发布于:2007-07-18 09:42
budong
|
|
2楼#
发布于:2007-10-06 10:03
<FONT color=#000080>#pragma</FONT> warning(push)<BR><CODE><FONT color=#000080>#pragma</FONT></CODE> warning(disable : 4192) <CODE><FONT color=#008000>/* Ignore warnings for types that are duplicated in win32 header files */</FONT></CODE><BR><CODE><FONT color=#000080>#pragma</FONT></CODE> warning(disable : 4146) <CODE><FONT color=#008000>/* Ignore warnings for use of minus on unsigned types */</FONT></CODE><BR><BR><CODE><FONT color=#000080>#import</FONT></CODE> "\Program Files\ArcGIS\com\esriSystem.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids, exclude("OLE_COLOR", "OLE_HANDLE", "VARTYPE")<BR><CODE><FONT color=#000080>#import</FONT></CODE> "\Program Files\ArcGIS\com\esriSystemUI.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids<BR><CODE><FONT color=#000080>#import</FONT></CODE> "\Program Files\ArcGIS\com\esriGeometry.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids<BR><CODE><FONT color=#000080>#import</FONT></CODE> "\Program Files\ArcGIS\com\esriDisplay.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids<BR><CODE><FONT color=#000080>#import</FONT></CODE> "\Program Files\ArcGIS\com\esriOutput.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids<BR><CODE><FONT color=#000080>#import</FONT></CODE> "\Program Files\ArcGIS\com\esriGeoDatabase.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids<BR><CODE><FONT color=#000080>#import</FONT></CODE> "\Program Files\ArcGIS\com\esriCarto.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids<BR><BR><CODE><FONT color=#008000>// Some of the Engine controls</FONT></CODE><BR><CODE><FONT color=#000080>#import</FONT></CODE> "\Program Files\ArcGIS\bin\TOCControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids<BR><CODE><FONT color=#000080>#import</FONT></CODE> "\Program Files\ArcGIS\bin\ToolbarControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids<BR><CODE><FONT color=#000080>#import</FONT></CODE> "\Program Files\ArcGIS\bin\MapControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids<BR><CODE><FONT color=#000080>#import</FONT></CODE> "\Program Files\ArcGIS\bin\PageLayoutControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids<BR><BR><CODE><FONT color=#008000>// additionally for 3D controls</FONT></CODE><BR><CODE><FONT color=#000080>#import</FONT></CODE> "\Program Files\ArcGIS\com\esri3DAnalyst.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids<BR><CODE><FONT color=#000080>#import</FONT></CODE> "\Program Files\ArcGIS\com\esriGlobeCore.olb" raw_interfaces_only, raw_native_types, no_namespace, named_guids<BR><CODE><FONT color=#000080>#import</FONT></CODE> "\Program Files\ArcGIS\bin\SceneControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids<BR><CODE><FONT color=#000080>#import</FONT></CODE> "\Program Files\ArcGIS\bin\GlobeControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids<BR><BR><CODE><FONT color=#000080>#pragma</FONT></CODE> warning(pop)<BR>
|
|
|
3楼#
发布于:2008-06-10 17:53
<P><FONT color=#000080>#import "TOCControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids</FONT><BR>后面直接加上</P>
<P>exclude("esriControlsMousePointer","esriControlsDragDropEffect","esriControlsDropAction","esriControlsAppearance","esriControlsBorderStyle")</P> |
|