AnsweredAssumed Answered

Geoprocessor: ProgressChangedEvent not Firering

Question asked by dbachmann on Jul 6, 2016

Hi,

I'm trying to create a mpk-File from within an ArcMapAddIn. Like this:

Geoprocessor geoprocessor = new Geoprocessor();    
 

geoprocessor.OverwriteOutput = true;
geoprocessor.ToolExecuted += new EventHandler<ESRI.ArcGIS.Geoprocessor.ToolExecutedEventArgs>(geoprocessor_ToolExecuted);
geoprocessor.ProgressChanged += new EventHandler<ESRI.ArcGIS.Geoprocessor.ProgressChangedEventArgs>(geoprocessor_ProgressChanged);
ESRI.ArcGIS.DataManagementTools.PackageMap packageMap = new ESRI.ArcGIS.DataManagementTools.PackageMap();

.
.
.

IGeoProcessorResult2 result = null;
try
{
    result = geoprocessor.ExecuteAsync(packageMap) as IGeoProcessorResult2;
}
catch(COMException ex)
{

MessageBox.Show(ex.Message + "\r\n" + ex.ErrorCode);

String str = "";

for(int i = 0; i < geoprocessor.MessageCount; i++)

{
    
str = str + "\r\n"+ geoprocessor.GetMessage(i);

}

MessageBox.Show(str);

return;

}

 

The ToolExecuted-Event is fired, but the ProgressChangedEvent is never fired.

Any Idee, what I'm doing wrong?

 

Thanks in advance,

Daniel

Outcomes