zoukankan      html  css  js  c++  java
  • 当ArcEngine报事件同时存在于AxMapControl,MapControl时的解决方法(转载)

    开发环境:VS.Net 2005(C#)
    AE版本:9.2 sp4

    报错的内容:
    The type 'ESRI.ArcGIS.MapControl.IMapControlEvents2_OnOleDropEventHandler' exists in both 'e:\Program Files\ArcGIS\DotNet\ESRI.ArcGIS.MapControl.dll' and 'e:\ProgramFiles\ArcGIS\DotNet\ESRI.ArcGIS.AxMapControl.dll'
    解决方法:

    1. In VS.NET 2005, go to your project's References folder in Solution Explorer. Select ESRI.ArcGIS.AxMapControl or ESRI.ArcGIS.MapControl. In the Properties Pane, change Aliases from global to global, MapControlAlias.

    将AxMapControl,MapControl都加入到引用中,修改ESRI.ArcGis.AxMapControl引用的属性,修改其Aliases(别名)由"global" to "global, MapControlAlias";
    2. In your code at the first line in the file add: extern alias MapControlAlias;
    在其他命名空间之前添加extern alias MapControlAlias;
    3. Add alias to your ambiguous call. Ex. this.axMapControl1.OnMouseMove += new MapControlAlias::ESRI.ArcGIS.MapControl.IMapControlEvents2_OnMouseMoveEventHandler(this.axMapControl1_OnMouseMove);
    在冲突的地方,加上别名::想要调用的对象
    This should work, don't worry about trying to do commandline /references as I couldn't figure it out, but the Properties Alias worked. 

    修改后,如下:
    引用代码:
    extern alias MapControlAlias;

        using DevExpress.XtraEditors;
        using DevExpress.XtraEditors.Controls;
        using ESRI.ArcGIS.Carto;
        using ESRI.ArcGIS.DataSourcesFile;
        using ESRI.ArcGIS.DataSourcesRaster;
        using ESRI.ArcGIS.esriSystem;
        using ESRI.ArcGIS.Geodatabase;


    类中代码:
    this.axMapControl1.OnMouseMove += new MapControlAlias::ESRI.ArcGIS.MapControl.IMapControlEvents2_OnMouseMoveEventHandler(this.axMapControl1_OnMouseMove);
    this.axMapControl1.OnAfterDraw += new MapControlAlias::ESRI.ArcGIS.MapControl.IMapControlEvents2_OnAfterDrawEventHandler(this.axMapControl1_OnAfterDraw); 

    来源于:http://forums.esri.com/thread.asp?c=159&f=1707&t=171978&mc=6
  • 相关阅读:
    linux下解除端口占用
    设计模式(二)观察者模式
    设计模式(一) 策略模式
    loj #6235. 区间素数个数
    loj #2013. 「SCOI2016」幸运数字
    loj #6014. 「网络流 24 题」最长 k 可重区间集
    loj #6013. 「网络流 24 题」负载平衡
    loj #2255. 「SNOI2017」炸弹
    loj #2051. 「HNOI2016」序列
    loj #6122. 「网络流 24 题」航空路线问题
  • 原文地址:https://www.cnblogs.com/bobzhangfw/p/1158261.html
Copyright © 2011-2022 走看看