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
Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Adjusting preferred arrival setting

This is a discussion on Adjusting preferred arrival setting within the MapPoint Desktop Discussion forums, part of the Map Forums category; I think you will need to make the drawing toolbar visible and let the user click it. There is this ...

  1. #11
    John Meyer's Avatar
    John Meyer is offline Senior Member Blue Belt
    Join Date
    Jul 2002
    Posts
    478
    I think you will need to make the drawing toolbar visible and let the user click it.

    There is this thread that explains how to extend the activex control to allow you to get things not otherwise available like the location sensor but I'm not sure about drawing tool selection.

    Access some hidden features in MapPoint2002 ActiveX control
    http://www.mp2kmag.com/mappoint/disc...extend+activex

  2. #12
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    Thx, I've got the drawing function with extending the ActiveX

    (for people that are interested in the c# code:

    Code:
    [DllImport("user32", EntryPoint="PostMessage")] public static extern int PostMessageA(int hwnd, int wMsg, int wParam, int lParam); 
    
    [DllImport("user32", EntryPoint="FindWindowEx")] public static extern int FindWindowExA(int hWnd1, int hWnd2, string lpsz1, string lpsz2); 
    
    windowhandler = MapControl.Handle.ToInt32();   
    windowhandler = FindWindowExA(windowhandler,0,"ATL:10022070","");
    windowhandler = FindWindowExA(windowhandler,0,"AfxFrameOrView42","");
    
    (this gets the correct handler)
    
    PostMessageA(windowhandler,273,58205,0);  //freehand drawing 
    PostMessageA(windowhandler,273,35313,0);  // displays dialog with icons you can show
    PostMessageA(windowhandler,273,58224,0); // measure distance
    PostMessageA(windowhandler,273,35488,0);  //Changes the globeview between square and circle
    PostMessageA(windowhandler,273,35316-35320,0);//changes fontsize
    PostMessageA(windowhandler,273,35391-35394,0);//changes the shown data

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

    Re: Adjusting preferred arrival setting

    Quote Originally Posted by Anonymous
    How can i adjust the preferred arrival and departure time of a waypoint??? I'm working with C#.

    I tried several options:

    way = ActiveMap.ActiveRoute.Waypoints.Add(pin,name);
    way.PreferredArrival = preferredarrivalarray[i];

    Doesn't work, it says "Access denied"

    ActiveMap.ActiveRoute.Waypoints[i].PreferredArrival = preferredarrivalarray[i];

    Also doesnt work now it says:

    "Property, indexer, or event 'this' is not supported by the language; try directly calling accessor method 'MapPoint.Waypoints.get_Item(ref object)"

    ActiveMap.ActiveRoute.Waypoints.get_Item(This expects an object but wath object????? )

    Can anyone help?

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

    Access Denied when setting PreferredArrival property

    The problem resides in the fact that you only have one waypoint in the route. As soon as you add more than one waypoint the problem disappears.

    The example in VB always adds 2 waypoints to the route.
    If you change the code to only add one waypoint you will get the error.

    Just make sure you have at least 2 waypoints in your route.

    Unfortunately MapPoint works fine when you only have one waypoint in your route. But the API does not allow it!!!!!!


    Robert.

  5. #15
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    In addition it is maybe interesting to mention that you can do anything that has a shortcut key in mappoint also in code by using the win32 api call keybd_evtent.

    eg this code first popup the popup window in mappoint, select a pushpin andmove the balloon to lower right. It go very fast, a 'normal' user will not see what happens.

    Code:
                const byte VK_APPS = 93;
                const int KEYEVENTF_KEYUP = 2;
                PP.Select();
                Win32.keybd_event(VK_APPS, 0, KEYEVENTF_KEYUP, 0);  // popup window
                Win32.keybd_event((byte)'O', 0, 0, 0);              // Orientation
                Win32.keybd_event((byte)'L', 0, 0, 0);              // Lower right
                unSelectPushPin(PP);
    The definition for keybd_event is this:

    Code:
    public extern static void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo);
    Also remember keyboard keys are always capital letters (just think on the history of a computer)

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Display setting for Map
    By alwasl8 in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-07-2005, 10:37 PM
  2. How to choose Fast, Short or Preferred itineray
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-10-2004, 04:14 AM
  3. return the waypoint arrival time
    By CSG in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 06-24-2004, 07:34 AM
  4. Planning a route after arrival times
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 02-24-2003, 08:11 AM
  5. Adjusting Road Speeds
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 01-10-2003, 04:59 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