Data Manager Tools in stand-alone vb.net program

1368
9
08-29-2016 02:15 PM
JonDewalt
New Contributor

The tools in the data manager toolbar can be accessed programmatically outside of an ArcMap session. How?  I have a stand-alone program that uses the ArcPad Toolbox to do check-in and outs.  The program has been in use for 7 years now but after upgrading to ArcGIS 10.3, we are getting C++ runtime errors.  I would like to try to update the program to use the data manager tools but am at a loss as to where to start.  Any suggestions would be helpful.  Our program is developed in vb.net.

Thanks,

Jon

0 Kudos
9 Replies
RebeccaStrauch__GISP
MVP Emeritus

I'm not sure about the C++ runtime error, but have you installed the VBA compatibility software for 10.3.x?  My arcpad is typically all one-way (collection to new files) so I haven't used the toolbox sync, but this might help.

edit:  Jon, yes sorry about that....VB.net   my mind auto saw VBA.  Sorry.

0 Kudos
JonDewalt
New Contributor

I have not used the VBA compatibility software.  Our stand-alone program is pure vb.net.   Our check-in and out procedures reference the ArcPad Toolbox and they still function but after upgrading to ArcGIS 10.3, we get a C++ runtime error as soon as the geoprocessor is initiated, before we even use the ArcPad tools.   I was hoping that if the Data Manager Tools can now be used outside of an ArcMap session then I could avoid using the geoprocessor object and thus avoid the issues we have been having.

0 Kudos
MarikaVertzonis
Esri Regular Contributor

Jon - What version of ArcPad are you using?

At version 10.2.2 we made some improvements to the tools so they can be better executed outside of ArcMap.

Also, what version of ArcMap did you upgrade FROM? This is important, because there were key changes with registration of tools after ArcMap 10.0. For more info see arcgis desktop - Python scripting for ArcPad Checkin - Geographic Information Systems Stack Exchange 

0 Kudos
JonDewalt
New Contributor

Our current setup uses ArcPad 10.2.0.99 with ArcEngine 10.1.  We are in the process of upgrading to ArcEngine 10.3.  the current setup still works but our now getting C++ runtime error.  I did this

http://support.esri.com/technical-article/000013127 and I think that may have taken care of that runtime issue.

This is our current code, more or less: No Python is used, strictly vb.net

Dim pGeoProcessor2 As IGeoProcessor = New GeoProcessorClass()

Dim parameters As IVariantArray = New VarArrayClass()

With parameters

.Add(FeatureClassFullPath)

.Add(p_SyncData.SchemaOnly.ToString)

.Add(p_SyncData.AXFPassword)

.Add(p_SyncData.EncryptAXF.ToString)

.Add(tmpOutputFile)

End With

pGeoProcessor2.Execute("ArcPadCheckout_ArcPad", parameters, Nothing)

I have a custom procedure that hunts down adds the toolbox if the tool is not found.

We often get this error but it is intermittent and not at all consistent as to when it happens:

 Check-out Com Error: -2147417851 - The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)) --    at ESRI.ArcGIS.Geoprocessing.GeoProcessorClass.Execute(String Name, IVariantArray ipValues, ITrackCancel pTrackCancel)

I got the impression from the what's new in the latest ArcPad, that is could access the check-out and check-in tools without using the geoprocessor but I can't find any information on how to do that.  I installed ArcPad 10.2.3.36 to try it out but there is no mention in the help how to access the data manager tools.  I also noticed that there are three extra parameters when using the check-out tool via the toolbox (regarding pictures) but the tool help does not mention those new parameters nor does it show them being used in script.  With the latest ArcPad installed, I was hoping that direct access to the data manager tools would perhaps eliminate once and for all the above error.  I have 400 copies of my program running and it has completed over 30,000 check-out check-ins over the past 7 years.

Since upgrading to the latest ArcPad, the above code throws the com error everytime.  I tried adding the extra parameters in the order they appear in the toolbox window in ArcMap but still no success.  Today I will do more testing on a machine with 10.2.0.99 and one with 10.2.3.36.

If you would like to see more of the code or if you have any suggestions on improving our check-out and check-in methods.  Our users all have ArcPad to do their data collection, my program to do the check-in and check-outs and either ArcEngine or ArcDesktop.

Thanks

0 Kudos
StephenQuan1
Esri Contributor

Hi Jon,

There were issues in earlier versions of ArcPad 10.x when used outside of ArcMap, aka ArcEngine, so I do recommend you try ArcPad 10.2.3 which definitely has those ArcEngine fixes. You can also access ArcPad Data Manager objects without going through the GeoProcessor by using the IArcPadExchange interface.

Stephen

0 Kudos
JonDewalt
New Contributor

Would you have examples how to do that. I haven't been able to find any and when i tried to reference the tools they came in as com objects and not . Net

Sent from the far reaches of the galaxy

0 Kudos
StephenQuan1
Esri Contributor

Hi Jon,

I know how to do this in C++ and C#.

To create instances of the classes in C#, it's:

IArcPadExchangeTransaction2 trans = new ArcPadExchangeClass();

IArcPadExport exp = new ArcPadExportClass();

I suggest you contact ESRI Technical Support to obtain a sample in VB .NET.

Stephen

0 Kudos
JonDewalt
New Contributor

I can convert c# . What dll needs to be referenced to access the objects?

Thanks

Sent from the far reaches of the galaxy

0 Kudos
StephenQuan1
Esri Contributor

ArcPadToolsGen2.dll

0 Kudos