ArcGIS Engine + C # instance development tutorial bug and optimization solution 1

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.