Select to view content in your preferred language

Geoprocess Progress in foreground

3462
2
03-25-2011 02:50 AM
AntonSeiler
Emerging Contributor
Hello,

I execute programmatically (vb.net) a geoprocess from the toolbox. In ArcMap I have a commandbutton that execute this geoprocess-tool. If I start this tool from toolbox, I get the progress dialog, but when I start this tool programmatically I get no feetback - why?


Dim gp As ESRI.ArcGIS.Geoprocessing.IGeoProcessor2 = New ESRI.ArcGIS.Geoprocessing.GeoProcessor
Dim pVariantArray As ESRI.ArcGIS.esriSystem.IVariantArray = New ESRI.ArcGIS.esriSystem.VarArray
Dim pTrackCancel As ESRI.ArcGIS.esriSystem.ITrackCancel = New ESRI.ArcGIS.Display.CancelTracker
pTrackCancel.CancelOnClick = True
pVariantArray.Add(pWorkspace)
gp.LogHistory = True
gp.Execute(sToolname, pVariantArray, pTrackCancel)




Thanks for answers,
Anton
0 Kudos
2 Replies
MichaelRobb
Honored Contributor
gp.message
0 Kudos
VivekPrasad
Deactivated User
Hello, 

I execute programmatically (vb.net) a geoprocess from the toolbox. In ArcMap I have a commandbutton that execute this geoprocess-tool. If I start this tool from toolbox, I get the progress dialog, but when I start this tool programmatically I get no feetback - why? 


Dim gp As ESRI.ArcGIS.Geoprocessing.IGeoProcessor2 = New ESRI.ArcGIS.Geoprocessing.GeoProcessor
Dim pVariantArray As ESRI.ArcGIS.esriSystem.IVariantArray = New ESRI.ArcGIS.esriSystem.VarArray
Dim pTrackCancel As ESRI.ArcGIS.esriSystem.ITrackCancel = New ESRI.ArcGIS.Display.CancelTracker
pTrackCancel.CancelOnClick = True
pVariantArray.Add(pWorkspace)
gp.LogHistory = True
gp.Execute(sToolname, pVariantArray, pTrackCancel)




Thanks for answers, 
Anton


Hi,

Please try the below code sample...

Dim pProDlg As IProgressDialog2
Dim pTrkCan As ESRI.ArcGIS.esriSystem.ITrackCancel
Dim pProDlgFact As IProgressDialogFactory

â?? Create a CancelTracker, required, even though we cannot use it..
pTrkCan = New CancelTracker

' Create the ProgressDialog. This automatically displays the dialog

pProDlgFact = New ProgressDialogFactory
pProDlg = pProDlgFact.Create(Nothing, 0) 'Application.hWnd)

' Set the properties of the ProgressDialog
'pProDlg.CancelEnabled = True
pProDlg.Description = "Please wait till this Window closes" & vbNewLine & "Do not try to close this window"
pProDlg.Title = "Process: Copy Raster..."
pProDlg.Animation = esriProgressAnimationTypes.esriProgressGlobe


<<<<<GeoProcessing Task>>>>>

pProDlg.HideDialog()
pTrkCan = Nothing
pProDlg = Nothing
0 Kudos