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 3 of 3

Has anyone had any problems setting the value of t....

This is a discussion on Has anyone had any problems setting the value of t.... within the MapPoint Desktop Discussion forums, part of the Map Forums category; Has anyone had any problems setting the value of the PreferredDeparture property in the Waypoint object? I was having problems ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    Has anyone had any problems setting the value of the PreferredDeparture property in the Waypoint object? I was having problems with this a while ago, but the situation was more complicated because I was using Borland's C++ Builder. I have now re-written my code using the standard IDispatch interface, but changes to PreferredDeparture are just ignored. Unfortunately, I don't have access to a copy of VB so I'm still using C++. My code does work with MapPoint 2001 but not 2002. Has anyone tried setting PreferredDeparture in a VB application?

  2. #2
    Walt Cygan is offline Senior Member Green Belt
    Join Date
    Aug 2002
    Posts
    124
    I tried the following code in a VB app with the MapPoint ActiveX control called "ctlMapPoint" and a Command button called "cmdTest":


    Private Sub cmdTest_Click()

    On Error GoTo ErrSub

    Dim objMap As MapPointCtl.Map

    Dim objRoute As MapPointCtl.Route

    'Set up the application

    Set objMap = ctlMapPoint.ActiveMap

    Set objRoute = objMap.ActiveRoute

    'Add two waypoints to the map

    objRoute.Waypoints.Add objMap.FindResults("Seattle, WA").Item(1)

    objRoute.Waypoints.Add objMap.FindResults("Spokane, WA").Item(1)

    'Set the time you'd like depart from the start point

    objRoute.Waypoints.Item(1).PreferredDeparture = TimeValue("8:00:00 AM")

    objRoute.Calculate

    ExitSub:

    Set objRoute = Nothing

    Set objMap = Nothing

    Exit Sub

    ErrSub:

    Resume ExitSub

    End Sub


    This worked perfectly.


    - Walt Cygan

  3. #3
    Shragel is offline Junior Member Yellow Belt
    Join Date
    Jul 2006
    Posts
    16

    Re: Has anyone had any problems setting the value of t....

    You must first add two waypoints before you can set preferred departure.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Re-setting Size of Map saved
    By cableghost in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 02-06-2006, 12:27 PM
  2. Display setting for Map
    By alwasl8 in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-07-2005, 10:37 PM
  3. Setting Dataset at runtime?
    By shadbell in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 12-17-2003, 10:25 AM
  4. setting addresses in canada,
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 10-22-2003, 08:27 PM
  5. Setting Speeds
    By aarunprakash in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 06-06-2003, 01:45 PM

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