Abstract: Bug and optimization solution 1 in the ArcGIS Engine + C # instance development tutorial. The bug and solution of the tutorial found so far in the Sixth Lecture are as follows.
1. Desktop GIS applicationsProgramFramework Establishment
Ii. Menu addition and implementation
Third, synchronize mapcontrol with pagelayoutcontrol
Lecture 4 Add and implement status bar Information
Fifth, the implementation of eagleeye
Sixth, right-click menu addition and implementation
Tutorial bug and optimization solution 1
7. Implementation of layer symbol selector 1
7. Implementation of layer symbol selector 2
Lecture 8 query and display of attribute data tables
The bug in the tutorial that has been found so far and the solution is as follows:
1. In the second lecture, variables may be undefined.
Cause: the second lecture is closely related to the third lecture. I divided it into two lectures to control the length. Some variables are defined in the third lecture. Please note that.
2. In the sixth lecture, the right-click menu of toccontrol cannot be displayed.
Cause: the m_toccontrol pointer is not obtained, that is, the m_toccontrol pointer is not bound to the axtoccontrol1 control. As a result, m_menumap.popupmenu (E. x, E. y, m_toccontrol.hwnd); When m_toccontrol.hwnd is null, the menu cannot be displayed.
Solution: In the formateload () function, add the followingCode:
M_toccontrol = (itoccontrol2) This. axtoccontrol1.object; |
Currently, the following optimization solutions are available:
1. In the fourth part of the tutorial, ESRI in front of the coordinate unit is replaced by the switch statement one by one. In fact, it is more convenient to take the substring directly.
The modification code is as follows:
Coordinatelabel. TEXT = "Current coordinate X =" + E. mapX. tostring () + "Y =" + E. mapy. tostring () + "" + this. axmapcontrol1.mapunits. tostring (). substring (4 ); |
2. In the fourth tutorial, set the scale in the status bar and the width of the current coordinate item to prevent flickering.
The method is as follows:
Select the scale or current coordinate item in the status bar, set its autosize attribute to false, and then set the width in the size attribute. The scale width is 150, and the current coordinate width is 400.