Friday, December 12, 2008

ESRI StreetMap Mobile (ArcLogistics Navigator) on a Pocket PC 2003

Last August, i have developed a a navigation application with routing functionality but it was made to run on a ruggedized (xplore) pc with windows xp tablet edition. a couple o days a ago, i got a pocket pc 2003 so i thought i would try to migrate my application to run on the pocket pc, well during the migration, i faced many problem,

  1. you need to register smmobile.dll on the device.
  2. picturebox.CreateGraphics() function doesn't work on the .NET CF.
  3. you need to migrate ur all ur custome made controls and dlls to work with the device.
  4. IMapDocument.GetRouter() returns an Exception "Unable to obtain server's security context" with ErrorCode: -2147220991
many are in the way i pretty sure, i will reporting back with the solutions once im done, but its not a pleasent experience at all since that StreetMap Mobile is not anymore included in the EDN and its now is included in the special services & the samples are in C# windows applications.

wish me luck

UPDATE:

You need to register smmobile.dll on the device:
for this, actually it was not straight forward, i had to experiment and brain storm, first of all, SM help doesn't show show anything about programming on mobile devices and all the examples are done for VB.NET, to register a smmobile.dll com, you need the regsvrce.exe which is made for mobile devices, you just need to upload it to the device and and run it from the device and it will ask you for the full path of the dll you want to register.

the second part of this process is the smmobile.dll, well the one which you find in the C:\Program Files\StreetMapMobile\bin when install it doesn't register, and it shows an error "LoadLibrary [filepath] failed GetLastError Returns c1" well, digging more into this i found out that the dll is not compiled for mobile devices and you need to re-compile the dll for a mobile device ?? ehmm ehmm, there is now way to get that unless you get the source ?? right !!. i started looking around and i found the installation for the ESRI Navigator sample but that was C:\Program Files\StreetMapMobile\SampleApps\WM5_PocketPC\ESRINavigator.CAB, i extracted it and i was searching in the files and i saw a file named like this "smmobile.058" so i thought that this is for sure the file, i changed its extension to .dll and uploaded it to the device and BANG, it registered. here are the links for regsvrce.exe and smmobile.dll


picturebox.CreateGraphics() function doesn't work on the .NET CF:

the Control.CreateGraphics() is supported in .NET CF 3.5 only and any version prior to that, need to override the paint method of the control, look at this discussion here.

you need to migrate ur all ur custome made controls and dlls to work with the device.

if you have developed a class library or a control library, you need to redevelop the same for the same device in order to work with your project, and believe me, it is not the same ?? you will amazed that many functions are not available in the CF where you have to find workaround for example, i had a panel with double buffering enabled usercontrol, and now i can't enable double buffering anymore !!

1 comment:

Anonymous said...

It sounds like you're creating problems yourself by trying to solve this issue instead of looking at why their is a problem in the first place.