Analysis and solution of common errors in ArcEngine development

This paper enumerates several common error reporting in ArcEngine development process, analyzes the reason of error reporting and expounds the solution.
[Error 1] :
“ArcGIS Version Not specified. You must CallRunTimeManager.Bind before creating any ArcGIS Components.”

The solution: the main function of the entrance of the program to add binding software license version of the code “. ESRI ArcGIS. RuntimeManager. Bind (. ESRI ArcGIS. ProductCode. EngineOrDesktop);” .

>
An error “HRESULT: 0 x80040258”

Solution:
IWorkspacepWorkspace =pWorkspaceFactory.OpenFromFile(pShpPath,0);  
For example, pShpPath is just the path name. For example, C:\\AAA will not report an error. If you use the full path name C:\\AAA\ bbb.shp, you will report an error.

>
An error “HRESULT: 0 x80040228”

Solution: Add a License control to the form.

>
Drag an ArcGIS control into the form and report an error

Solution:
Open ArcGIS License Server Administrator10.1 and start License Service.

>

An error “HRESULT: 0 x80040351”

Solution: pFeatureWorkspace. OpenFeatureClass () the parameters of the brackets should be “samplepoint. SHP” rather than an absolute path, modify the absolute path to the file name.

>

Error “Exception from HRESULT:0x80040207”
Solutions:
When queryFilter.whereClause is used to query shapefile layers, it is found that the queryFilter.whereClause statement is used to query shapefile layers. Open ArcGIS and compare the following differences between the two formats of attribute query:
1. Shapefile field names are in double quotes such as “fieldName” and GDB is in [fieldName] format;
2. The fuzzy query shapefile with like ‘% A %’ and GDB USES like ‘* A *’;
3. The non-character field of shapefile does not support fuzzy query but GDB format supports;

>
. Use the statement “ESRI ArcGIS. Geometry. IPointpoint = new ESRI. ArcGIS. Geometry. PointClass ();”
=
=
=
=

Solution: Select Esri.ArcGIS.Geometry from the Solution Reference, right-click the menu to view the Properties, and change “Embedded Interop Type” from True to False.


Read More: