public static List <int> DetectWrongWaypoints(string inPath) //inPath = name of itinerary (i.e. "default")
        {
            SStopOffPoint[] wp;
            List <int>      ids = new List <int>();

            CApplicationAPI.GetItineraryList(out _mySError, inPath, out wp, 0);

            if (wp != null)
            {
                for (int i = 0; i < wp.Length - 1; i++)
                {
                    SStopOffPoint[] tmpWp = new SStopOffPoint[2];
                    tmpWp[0]            = wp[i];
                    tmpWp[0].nPointType = 3;

                    tmpWp[1]            = wp[i + 1];
                    tmpWp[1].nPointType = 2;

                    CApplicationAPI.AddItinerary(out _mySError, tmpWp, inPath + "-" + i.ToString(), 0);
                    int result = CApplicationAPI.SetRoute(out _mySError, inPath + "-" + i.ToString(), 0, true, 0);
                    if (result != 1)
                    {
                        ids.Add(i + 1);
                    }
                }
            }
            return(ids);
        }
        public static void AddItineraryTest()
        {
            SStopOffPoint[] points = new SStopOffPoint[3];
            points[0] = new SStopOffPoint();
            points[1] = new SStopOffPoint();
            points[2] = new SStopOffPoint();

            points[0].SetCaption("1. waypoint: start");
            points[0].nPointType = 3; //3=start point
            points[1].SetCaption("2. waypoint: via point");
            points[1].nPointType = 1; //1=waypoint
            points[2].SetCaption("3. waypoint: finish");
            points[2].nPointType = 2; //2=finish pint
            int ret = CApplicationAPI.AddItinerary(out _mySError, points, "testing", 0);

            O("AddItinerary returns: " + ret.ToString());
        }
        public static void AddItinerary(string inStrName)
        {
            SStopOffPoint[] points = new SStopOffPoint[2];

            points[0]             = new SStopOffPoint();
            points[0].Location.lX = 1712574;
            points[0].Location.lY = 4815034;
            points[0].nPointType  = 3;
            points[0].SetCaption("Starting point");

            points[1]             = new SStopOffPoint();
            points[1].Location.lX = 1714375;
            points[1].Location.lY = 4814980;
            points[1].nPointType  = 2;
            points[1].SetCaption("Finish point");

            int ret = CApplicationAPI.AddItinerary(out _mySError, points, inStrName, 0);

            O("AddItinerary returns: " + ret.ToString());
            if (ret == 1)
            {
                O("The itinerary containing two waypoints has been added into the navigation sucessfully.");
            }
        }
        public static void AddItinerary(string inStrName, SStopOffPoint[] points)
        {
            int ret = CApplicationAPI.AddItinerary(out _mySError, points, inStrName, 0);

            O("AddItinerary returns: " + ret.ToString());
        }