Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 2 of 2

Driver profile in Visual Basic

This is a discussion on Driver profile in Visual Basic within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi, I'm developing a software project using the MapPoint Control, but I have a little problem. I can't include rests ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    Driver profile in Visual Basic

    Hi,

    I'm developing a software project using the MapPoint Control, but I have a little problem. I can't include rests in the Directions pane when calculating a route. I'm using this code:

    Dim oApp As MapPoint.Application
    Set oApp = GetObject(, "MapPoint.Application")
    Dim oDrvProf As MapPoint.DriverProfile
    Set oDrvProf = oApp.ActiveMap.ActiveRoute.DriverProfile

    oDrvProf.StartTime = "7:00 AM"
    oDrvProf.EndTime = "8:00 PM"

    oDrvProf.IncludeRestStops = True
    oDrvProf.TimeBetweenRests = 4 * geoOneHour
    oDrvProf.RestStopDuration = 45 * geoOneMinute

    oDrvProf.DrivingCostUnits = geoCostBasedOnDistance
    oDrvProf.DrivingCost = "1"

    Set oRte = oMap.ActiveRoute
    oRte.Clear
    With oRte.Waypoints
    .Add oMap.FindPlaceResults("Burgos")(1)
    .Add oMap.FindPlaceResults("Santiago de Compostela")(1)
    .Optimize
    End With
    oRte.Calculate
    'zoom.
    oRte.Directions.Location.GoTo

    Can you tell me where the problem is? I think I'm using it in the right way, but I'm not sure.

    Thanks a lot.

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    Hi again,

    I'm answering me. The problem is that I didn't use the DriverProfile object from the Mappoint.route object, so it didn't work.

    Now it works fine!!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Visual Basic 6.0
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 08-06-2004, 07:17 AM
  2. Visual Basic 6.0
    By fantef in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 04-15-2004, 12:41 PM
  3. mappoint, visual c++ vs visual basic
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 6
    Last Post: 03-30-2004, 10:17 PM
  4. Driver profile in Visual Basic
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 08-29-2003, 04:27 AM
  5. Visual basic or visual c++ in mappoint
    By misterb83 in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 02-14-2003, 09:31 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36