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.FormPrivate 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 = 0Private 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.ButtonFriend WithEvents btnStart As System.Windows.Forms.Button
Friend WithEvents btnPosition As System.Windows.Forms.ButtonFriend WithEvents button1 As System.Windows.Forms.Button
Friend WithEvents btnClear As System.Windows.Forms.ButtonFriend 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.MainMenuMe.btnVersion = New System.Windows.Forms.Button
Me.btnStart = New System.Windows.Forms.ButtonMe.btnPosition = New System.Windows.Forms.Button
Me.Timermessage = New System.Windows.Forms.TimerMe.txtGps = New System.Windows.Forms.TextBox
Me.button1 = New System.Windows.Forms.ButtonMe.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 SubPrivate 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 SubPrivate Sub n_RawGpsReceived(ByVal sender As Object, ByVal e As RawGpsReceivedEventArgs)
txtGps.Text = e.Nmea
End SubPrivate Sub btnVersion_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnVersion.Click
TryDim 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 SubPrivate Sub btnPosition_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnPosition.Click
TryDim 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 TryEnd 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 =
Falsen.NavigateToAddress("Orléans", "N152", "", "")
n.BringNavigatorToForeground()
End SubPrivate 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?