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 1 of 2 12 LastLast
Results 1 to 10 of 19

An API to Control MapPoint 2006 GPS Features - Part I of II

This is a discussion on An API to Control MapPoint 2006 GPS Features - Part I of II within the MP2K Magazine Articles forums, part of the Map Forums category; Paul Larson shares an API he developed to add programmatic GPS functionality to MapPoint code projects and includes a demo ...

  1. #1
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    An API to Control MapPoint 2006 GPS Features - Part I of II

    Paul Larson shares an API he developed to add programmatic GPS functionality to MapPoint code projects and includes a demo to illustrate how the API works.

    "With the release of MapPoint 2006 North America (MP2K6NA) earlier this year, many users have been elated with the new map content and the addition of GPS features and Driving Guidance to the product. Likewise, many developers have thus found issue with the lack of improvement to the MapPoint API, specifically in relation to these new features. Being of the latter group, I decided to roll-my-own API to add programmatic GPS functionality to my MapPoint code projects."

    Read the full article --
    An API to Control MapPoint 2006 GPS Features - Part I of II - MapPoint Articles - MP2K Magazine

    Discuss the article in this thread below by clicking on Post Reply or use the Quick Reply button on the right.
    Last edited by Eric Frost; 08-31-2006 at 11:23 AM.
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  2. #2
    Paul Larson is offline Senior Member Green Belt
    Join Date
    Sep 2005
    Location
    Battle Creek, Michigan
    Posts
    136

    Exclamation Author's Note: Using the mpGPS API with MapPoint 2006 EUROPE

    I've finally obtained a copy of MapPoint 2006 EUROPE, and noted a slight change needed in the code to handle a difference in this version.

    For some reason, Microsoft embedded a CrLf combo in the text of the button to toggle voice prompting. So, in the module mpGPS.vb, in the New() procedure, add the following code:

    'EDIT: In mappoint2006 EUROPE, there is a CrLf in the button caption for voice control:
    If hwToggleVoice = 0 Then hwToggleVoice = FindWindowEx(hwChild(3), 0, vbNullString, "Turn Voice" & ControlChars.CrLf & "Off (F7)")

    ...immediately before the line which reads:
    hwRepeatLastInstruction = FindWindowEx(hwChild(3), 0, vbNullString, "Repeat Instruction (Spacebar)")

    Also, you will of course need to update the sample project (mpGPSDemo) reference for Interop.MapPoint to the correct version when using it with the European desktop product.

    Best Regards,
    Paul Larson

  3. #3
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4
    Cool thanks, Eric
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  4. #4
    PC
    PC is offline Junior Member White Belt
    Join Date
    Jul 2002
    Posts
    5

    Thumbs up

    Wonderful article, thanks.

    When will part II be posted.

  5. #5
    nprimex1 is offline Junior Member White Belt
    Join Date
    Mar 2006
    Posts
    11
    awesome work ... i'm eagerly waiting for part II.

  6. #6
    srogillio is offline Junior Member White Belt
    Join Date
    Oct 2006
    Location
    austin, tx
    Posts
    3

    C# version

    Here is a version I use that is in C#. This code should compile and provide the basic toggling of the GPS Pane. Enjoy
    Attached Files Attached Files

  7. #7
    Enigma is offline Junior Member White Belt
    Join Date
    Aug 2006
    Posts
    9

    Re: An API to Control MapPoint 2006 GPS Features - Part I of II

    Great article, have recompiled for Mappoint Europe and it works fine. Anyone any clues how to extend this to hook the modal warning window pop up when navigation is selected and OK it automatically. Its a really annoying feature of mappoint!.

    Cheers Pete

  8. #8
    Paul Larson is offline Senior Member Green Belt
    Join Date
    Sep 2005
    Location
    Battle Creek, Michigan
    Posts
    136

    Re: An API to Control MapPoint 2006 GPS Features - Part I of II

    Hi Enigma

    I'm not envisioning distributing the code to dismiss this warning as a part of the API, simply for liability reasons. However, if you contact me directly, I'd be happy to provide a code snippet.

    Best Regards,
    Paul

  9. #9
    Enigma is offline Junior Member White Belt
    Join Date
    Aug 2006
    Posts
    9

    Re: An API to Control MapPoint 2006 GPS Features - Part I of II

    Hi Paul

    Thanks, I have sent you a PM.

    Cheers Pete

  10. #10
    Paul Larson is offline Senior Member Green Belt
    Join Date
    Sep 2005
    Location
    Battle Creek, Michigan
    Posts
    136

    Re: An API to Control MapPoint 2006 GPS Features - Part I of II

    Greetings!

    Since I've had numerous requests for the code to automatically dismiss the "Safety Warning" dialog when calling my ToggleGuidance() method, I'm posting the code here for public use.

    Simply replace the entire routine for ToggleGuidance() with the entire code below. (In module mpGPS.vb)

    Note: By using this code you assume full responsibility and risk, and agree not to hold Paul Larson nor Paul Larson, LLC liable for damages.


    '---BEGIN CODE---
    Public Sub ToggleGuidance()
    If lGPS_UseDrivingGuidance = False Then Dim myDismisser As New DismissSafetyWarning
    SendMessage(hwProvideDrivingGuidance, BM_CLICK, 0, 0)
    lGPS_UseDrivingGuidance = Not lGPS_UseDrivingGuidance
    End Sub

    Private Class DismissSafetyWarning
    Private IsDismissed As Boolean = False
    Public Sub New()
    Dim myThread As System.Threading.Thread
    myThread = New System.Threading.Thread(AddressOf DismissWarningThread)
    myThread.Start()
    End Sub
    Private Sub DismissWarningThread()
    Dim Retries As Integer
    Dim hwWarning As Integer
    Dim hwAgree As Integer
    For Retries = 1 To 10
    'wait 1/8 of a second
    System.Threading.Thread.Sleep(125)
    hwWarning = FindWindowEx(GetDesktopWindow, 0, vbNullString, "Safety Warning")
    If hwWarning <> 0 Then
    hwAgree = FindWindowEx(hwWarning, 0, "Button", "I &Agree")
    If hwAgree <> 0 Then
    SendMessage(hwAgree, BM_CLICK, 0, 0)
    IsDismissed = True
    End If
    End If
    Next
    End Sub
    End Class
    '---END CODE---


    Best Regards,
    Paul Larson

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Using Python to control MapPoint, Part 1
    By Eric Frost in forum MP2K Magazine Articles
    Replies: 2
    Last Post: 02-01-2010, 01:09 AM
  2. MapPoint Automation with C/C++ - Part 1
    By Eric Frost in forum MP2K Magazine Articles
    Replies: 10
    Last Post: 09-15-2006, 11:01 AM
  3. Access some hidden features in MapPoint2002 ActiveX control
    By baal_2000 in forum MapPoint Desktop Discussion
    Replies: 43
    Last Post: 08-29-2006, 11:46 AM
  4. Using Python to Control MapPoint, Part 2
    By Eric Frost in forum MP2K Magazine Articles
    Replies: 0
    Last Post: 07-11-2006, 08:41 PM
  5. Hi EB Can i use the Map point control features ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-14-2002, 03:03 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