The ArcPad Team Blog

Unofficial stuff from the team behind the World's leading mobile GIS platform

Tuesday, January 17, 2012

Customizing ArcPad with COM and .NET


If you're an ArcPad Developer, you would be familiar with the ArcPad Object Model, but, did you know that you also have access to a lot of objects from the Component Object Model (COM)?

In Windows there's a large number of useful COM objects (e.g. Scripting.FileSystemObject, Microsoft.XMLDOM, Microsoft.XMLHTTP, ADODB.Connection). Using these objects you can manipulate files, folders, manipulate XML documents, make REST/SOAP AJAX calls and connect to databases like SQL Server.

In Windows Mobile there's a useful subset of COM objects (e.g. Microsoft.XMLDOM, Microsoft.XMLHTTP, ADOCE.Connection).

Dim xmldom
Set xmldom = CreateObject("Microsoft.XMLDOM")
xmldom.loadXML "<helloworld></helloworld>"
MsgBox xmldom.xml

In addition to Windows, you can probably obtain 3rd party COM objects.

If you are savvy with Visual Studio you can create your own COM objects. There are various tutorials on the internet on how to do this. For example A Simple COM tutorial using ATL. Recently, I stumbled upon Raymund Macaalay's How to call a .NET DLL from a VBScript technical blog which I found to be a nice read. I followed the blog and was able to create his C# .NET class and call it from an ArcPad script!

In a nutshell, by leveraging COM you can customize ArcPad in even more ways.