Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Sat, 19 Apr 2008 17:06:00 -0700,    group: microsoft.public.mappoint.webservice        back       


help me pls   
I am getting system cant find the specified file  :GetDistance and i am using 
the trial version of mappoint and below is my code . thanks in advance.

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using MapPointApp;
using System.Configuration;

namespace MPDMService
{
    class MappointUtils
    {
      static string objTemplate = "NAMAP.ptt";

        public MapPointApp.Application mapApp = null;
        //public static MapPointApp.Application mapApp = null;
        // causes multiple instances to be not released properly
        static MapPointApp.Map oMap = null;

        public MappointUtils()
        {
            try
            {
                mapApp = new MapPointApp.ApplicationClass();
               // oMap = mapApp.NewMap("C:\\" + objTemplate);
                oMap = mapApp.NewMap("C:\\NAMAP.ptt");
              //  oMap = mapApp.NewMap(NAMAP.ptt);

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public double CalculateMilesPart1(Address addr1,
            Address addr2)
        {
            object key = 1;
            double value = 0;

            try
            {
                MapPointApp.Location objLoc1 = null;
                MapPointApp.Location objLoc2 = null;
                MapPointApp.FindResults res = null;

                MapPointApp.Route aroute1 = null;
                aroute1 = oMap.ActiveRoute;
                aroute1.Clear();

                res = oMap.FindAddressResults(addr1.StreetAddress,
                    addr1.City, "", addr1.State, addr1.Zip, addr1.Country);
                objLoc1 = (MapPointApp.Location)res.get_Item(ref key);

                res = oMap.FindAddressResults(addr2.StreetAddress,
                    addr2.City, "", addr2.State, addr2.Zip, addr2.Country);
                objLoc2 = (MapPointApp.Location)res.get_Item(ref key);

                aroute1.Waypoints.Add(objLoc1, "");
                aroute1.Waypoints.Add(objLoc2, "");
                aroute1.Calculate();
                value = aroute1.Distance;
                oMap.Saved = true;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return value;
        }

    }
}
date: Sat, 19 Apr 2008 17:06:00 -0700   author:   Mayur

Re: help me pls   
On Sat, 19 Apr 2008 17:06:00 -0700, Mayur
 wrote:

>I am getting system cant find the specified file  :GetDistance and i am using 
>the trial version of mappoint and below is my code . thanks in advance.

It would help if you'd let us know at which point in your code you're
getting that error, the exact text of the exception, the routine
you're calling and the parameters you're passing ...

From your code, it looks like you're using MapPoint the desktop
application while this newsgroup targets the MapPoint web service -
you may want to repost in news:microsoft.public.mappoint.

   Regards,
   Gilles [MVP].

   (Please reply to the group, not via email.
   Find my MVP profile with past articles / downloads here: 
   http://www.gilleskohl.de/mvpprofile.htm)
date: Sun, 20 Apr 2008 07:46:23 +0200   author:   Gilles Kohl [MVP] no_email_available@

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us