AE development, call to COM component returned error HRESULT E_fail, error in geoprocessing, i.e. GP tool processing

Source: Internet
Author: User

Arcgisengine two times in the development, the geoprocessing, namely: Intersect operation, intersection take counter operation, erase operation and so on, if the permission is improperly assigned, it will appear on the face of COM component call returned error HRESULT e_fail error

The reasons for this are as follows: In the case of Erasure, intersection inversion, and other advanced operations, must be arcgisinfo level of license authorization, otherwise cannot operate, and intersect operation with arcgisengine level. (unstable, error-prone, recommendation 2)

The solution is as follows: 1. Use the Licencecontrol control to select the Arcgisinfo option, and select the spatial analysis

2. Add some code to the project startup Main method

            ESRI. ArcGIS.RuntimeManager.Bind (ESRI. ArcGIS.ProductCode.EngineOrDesktop);            #region Initialize license              iaoinitialize m_aoinitialize = new Aoinitializeclass ();            Esrilicensestatus licensestatus = esrilicensestatus.esrilicenseunavailable;            LicenseStatus = M_aoinitialize.initialize (esrilicenseproductcode.esrilicenseproductcodearcinfo);            if (LicenseStatus = = esrilicensestatus.esrilicensenotinitialized)            {                MessageBox.Show (" No esrilicenseproductcodearcinfo permission! ");                Application.exit ();            }            #endregion

One of the ESRI.ArcGIS.RuntimeManager.Bind (ESRI. ArcGIS.ProductCode.EngineOrDesktop); Two methods are required.

Note: You must have high permissions in front of the authorization, otherwise it will not work, the license to be added from high to low, from high to low sort: esrilicenseproductcodearcinfo, Esrilicenseproductcodearceditor,  Esrilicenseproductcodearcview, Esrilicenseproductcodearcserver, Esrilicenseproductcodeenginegeodb, Esrilicenseproductcodeengine

AE development, call to COM component returned error HRESULT E_fail, error in geoprocessing, i.e. GP tool processing

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.