.NET Components for Mobility

TOMTOMEXCEPTION

Last post 08-30-2008 2:23 AM by PeterFoot. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 08-05-2008 11:37 AM

    TOMTOMEXCEPTION

    HELLO

    I CONVERTED the project TOMTOMSAMPLE in visual basic

    this is the new code
     
    -------------------------------
    Imports InTheHand.TomTom

    ''' <summary>

    ''' Summary description for form.

    ''' </summary>

    Public Class Form1

    Inherits System.Windows.Forms.Form

    Private flashStrings As String() = New String() {"TomTom In The Hand Sample", "Using TomTom 5 and 6 SDKs", "Use TomTom from the .NET Compact Framework", "Copyright 2005-2007 In The Hand Ltd"}

    Private thisString As Integer = 0

    Private n As New InTheHand.TomTom.Navigator

    Private txtGps As TextBox

    ''' <summary>

    ''' Main menu for the form.

    ''' </summary>

    Private mainMenu1 As System.Windows.Forms.MainMenu

    Friend WithEvents btnVersion As System.Windows.Forms.Button

    Friend WithEvents btnStart As System.Windows.Forms.Button

    Friend WithEvents btnPosition As System.Windows.Forms.Button

    Friend WithEvents button1 As System.Windows.Forms.Button

    Friend WithEvents btnClear As System.Windows.Forms.Button

    Friend WithEvents Timermessage As System.Windows.Forms.Timer

     

    Public Sub New()

    InitializeComponent()

    End Sub

    ''' <summary>

    ''' Clean up any resources being used.

    ''' </summary>

    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

    MyBase.Dispose(disposing)

    End Sub

    #Region "Windows Form Designer generated code"

    ''' <summary>

    ''' Required method for Designer support - do not modify

    ''' the contents of this method with the code editor.

    ''' </summary>

    Private Sub InitializeComponent()

    Me.mainMenu1 = New System.Windows.Forms.MainMenu

    Me.btnVersion = New System.Windows.Forms.Button

    Me.btnStart = New System.Windows.Forms.Button

    Me.btnPosition = New System.Windows.Forms.Button

    Me.Timermessage = New System.Windows.Forms.Timer

    Me.txtGps = New System.Windows.Forms.TextBox

    Me.button1 = New System.Windows.Forms.Button

    Me.btnClear = New System.Windows.Forms.Button

    Me.SuspendLayout()

    '

    'btnVersion

    '

    Me.btnVersion.Location = New System.Drawing.Point(3, 29)

    Me.btnVersion.Name = "btnVersion"

    Me.btnVersion.Size = New System.Drawing.Size(126, 20)

    Me.btnVersion.TabIndex = 5

    Me.btnVersion.Text = "Get Version"

    '

    'btnStart

    '

    Me.btnStart.Location = New System.Drawing.Point(3, 3)

    Me.btnStart.Name = "btnStart"

    Me.btnStart.Size = New System.Drawing.Size(126, 20)

    Me.btnStart.TabIndex = 4

    Me.btnStart.Text = "Start TomTom"

    '

    'btnPosition

    '

    Me.btnPosition.Location = New System.Drawing.Point(3, 55)

    Me.btnPosition.Name = "btnPosition"

    Me.btnPosition.Size = New System.Drawing.Size(126, 22)

    Me.btnPosition.TabIndex = 3

    Me.btnPosition.Text = "Current Position"

    '

    'Timermessage

    '

    Me.Timermessage.Interval = 3000

    '

    'txtGps

    '

    Me.txtGps.Location = New System.Drawing.Point(4, 111)

    Me.txtGps.Name = "txtGps"

    Me.txtGps.Size = New System.Drawing.Size(233, 21)

    Me.txtGps.TabIndex = 2

    '

    'button1

    '

    Me.button1.Location = New System.Drawing.Point(3, 84)

    Me.button1.Name = "button1"

    Me.button1.Size = New System.Drawing.Size(126, 20)

    Me.button1.TabIndex = 1

    Me.button1.Text = "Navigate"

    '

    'btnClear

    '

    Me.btnClear.Location = New System.Drawing.Point(146, 29)

    Me.btnClear.Name = "btnClear"

    Me.btnClear.Size = New System.Drawing.Size(72, 20)

    Me.btnClear.TabIndex = 0

    Me.btnClear.Text = "Clear Route"

    '

    'Form1

    '

    Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit

    Me.ClientSize = New System.Drawing.Size(240, 268)

    Me.Controls.Add(Me.btnClear)

    Me.Controls.Add(Me.button1)

    Me.Controls.Add(Me.txtGps)

    Me.Controls.Add(Me.btnPosition)

    Me.Controls.Add(Me.btnStart)

    Me.Controls.Add(Me.btnVersion)

    Me.Menu = Me.mainMenu1

    Me.MinimizeBox = False

    Me.Name = "Form1"

    Me.Text = "TomTom In The Hand"

    Me.ResumeLayout(False)

    End Sub

    #End Region

    ''' <summary>

    ''' The main entry point for the application.

    ''' </summary>

    Private Sub timerMessage_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles Timermessage.Tick

    If Not n.IsApplicationRunning Then

    Timermessage.Enabled = False

    Return

    End If

    If thisString = flashStrings.Length Then

    thisString = 0

    End If

    n.FlashMessage(flashStrings(thisString), 2500)

    thisString += 1

    End Sub

    Private Sub btnStart_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnStart.Click

    n.StartApplication()

    AddHandler n.RawGpsReceived, AddressOf n_RawGpsReceived

    Timermessage.Enabled = True

    End Sub

    Private Sub n_RawGpsReceived(ByVal sender As Object, ByVal e As RawGpsReceivedEventArgs)

    txtGps.Text = e.Nmea

    End Sub

    Private Sub btnVersion_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnVersion.Click

    Try

    Dim A As String = n.ApplicationVersion.ToString()

    MessageBox.Show(n.ApplicationVersion.ToString(), "TomTom", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1)

    Catch ex As TomTomException

    MessageBox.Show(ex.ToString)

    End Try

    End Sub

    Private Sub btnPosition_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnPosition.Click

    Try

    Dim A As String = n.ApplicationVersion.ToString()

    MessageBox.Show(n.ApplicationVersion.ToString(), "TomTom", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1)

    Catch ex As InTheHand.TomTom.TomTomException

    MessageBox.Show(ex.ToString)

    End Try

    End Sub

     

    Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click

    'LocationInfo li = n.GetLocationInfo(new LatLong(52.41482, -4.08558));

    n.RouteSummaryVisible = False

    n.NavigateToAddress("Orléans", "N152", "", "")

    n.BringNavigatorToForeground()

    End Sub

    Private Sub btnClear_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnClear.ClickDim gi As InTheHand.TomTom.GeocodeInfo = n.Geocode("Orléans", "N152")

    n.ClearRoute()

    n.BringNavigatorToForeground()

    End SubEnd Class

     

    -------------------------------

     

     



    if click btnStart  is ok

    if click  btnVersion of a mistake that
     I have monitored with a catch tomtomexception
    with this result 

    in InTheHand.TomTom.Navigator.CheckResult() in InTheHand.TomTom.Navigator.get_ApplicationVersion() in DeviceApplication3.Form1.btnVersion_Click() in System.Windows.Forms.Control.OnClick() in System.Windows.Forms.Button.OnClick() in System.Windows.Forms.ButtonBase.WnProc() in System.Windows.Forms.Control._InternalWnProc() in Microsoft.AGL.Forms.EVL.EnterMainLoop() in System.Windows.Forms.Application.Run() in DeviceApplication3.Form1.Main()

     

    why?

  • 08-07-2008 5:29 AM In reply to

    Re: TOMTOMEXCEPTION

    When a TomTomException is thrown, check in the debugger - the Error property will contain a member of the TomTomError enumeration which indicates the cause of the error.

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 08-25-2008 6:59 AM In reply to

    Re: TOMTOMEXCEPTION

    Hi Peter  

    the error is

    {"TomTomException"} InTheHand.TomTom.TomTomException


      Error NoResponse {-2}

    why?

     

    Thanks

  • 08-26-2008 11:21 AM In reply to

    Re: TOMTOMEXCEPTION

    What version of the TomTom Application do you have? The latest is 6.033, there was an issue with one of the 6.0x releases where it would not respond to messages sent through the API.

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 08-27-2008 8:44 AM In reply to

    Re: TOMTOMEXCEPTION

    Hi Peter

     

    I installed the tomtom included in sdk version of tomtom with 6,033 and now I work all methods.

    - the start of TomTom

    - retrieval of lat and lon

    - addpoi


    to use addpoi is essential to the StartApplication ?

    or there can 'use a method without starting between the  tomtom Application


    thank you

     

    Aldo

  • 08-30-2008 2:23 AM In reply to

    Re: TOMTOMEXCEPTION

    Yes TomTom will need to be running to call these APIs but you can bring your application to the foreground to essentially hide TomTom. The other option you have is to use the details in the TomTom SDK documentation to write your own POI files directly as you can do this without running TomTom.

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
Page 1 of 1 (6 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.