Hi,
I am writing a small code to calculate the minimum distance between a point and a curve using the near tool in ArcGIS . The code is as follows
Imports ESRI.ArcGIS.Geoprocessor
Imports ESRI.ArcGIS.AnalysisTools
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim gp As ESRI.ArcGIS.Geoprocessor.Geoprocessor = New ESRI.ArcGIS.Geoprocessor.Geoprocessor
Dim neartool As ESRI.ArcGIS.AnalysisTools.Near = New ESRI.ArcGIS.AnalysisTools.Near()
neartool.in_features = "F:\Rajdeep-Assam\EQ_Source\FaultLine.shp"
neartool.near_features = "F:\Rajdeep-Assam\EQ_Source\Epicentre_2011.1.1_20.48.shp"
gp.OverwriteOutput = True
gp.Execute(neartool, Nothing)
MessageBox.Show("Done")
End Sub
End Class
When i run the code , it shows an error at the line gp.Execute(neartool, Nothing)
Error HRESULT E_FAIL has been returned from a call to a COM component.
What are the possible reasons ?
Thanks