Hi Folks,
I have been struggling with the same problem and was wondering if any progress has been made with this?
From what I can see in my code (listed below) the StartApplication() call does not do anything. Using the process viewer supplied with Visual Studio 2005 when this line of code executes, it would appear that a new process is not created - should this be the case? I would have thought the opposite would occur and a process would be created. Also, if I step through the following code and use the IsApplicationRunning method to determine if TomTom Nav has been opened from code, it consistenly returns false:
Code:
If SatNav.IsApplicationRunning.Equals(False) Then
'Start TomTom Application.
SatNav.StartApplication()
End If
Intermediate Window Output based on the start of the if statement and end of the if statement:
?satnav.isapplicationrunning
False
?satnav.isapplicationrunning
False
Below is the code I am implementing:
Public Class frmGPS
Private SatNav As New InTheHand.TomTom.Navigator
Private Sub btnTomTom_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTomTom.Click
Try
If SatNav.IsApplicationRunning.Equals(False) Then
'Start TomTom Application.
SatNav.StartApplication()
End If
SatNav.NavigateToAddress("Belfast", "Camden Street", "1", "BT9 6AT")
SatNav.SwitchToNavigatorView()
SatNav.TomTomApplicationToForeground()
Catch TomTomEx As InTheHand.TomTom.TomTomException
MsgBox(String.Concat(TomTomEx.Error, ": ", TomTomEx.Message))
Catch ex As Exception
MsgBox(ex.Message)
Finally
Try
If SatNav.IsApplicationRunning.Equals(True) Then
'Close operation is killed in the finally block.
SatNav.StopApplication()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Try
End Sub
End Class
Below is the exception generated when running the code:
TomTomEx {"TomTomException"} InTheHand.TomTom.TomTomException
Error NoResponse {-2} InTheHand.TomTom.TomTomError
InnerException Nothing System.Exception
Message "TomTomException" String
StackTrace at InTheHand.TomTom.Navigator.CheckResult() String
at InTheHand.TomTom.Navigator.NavigateToAddress()
at Dex_GPStest.frmGPS.btnTomTom_Click()
at System.Windows.Forms.Control.OnClick()
at System.Windows.Forms.Button.OnClick()
at System.Windows.Forms.ButtonBase.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at Dexterra.Framework.Engine.Run()
at Dex_GPStest.StartUp.Main()
I am using Vb.Net 2005, Compact Framework 2 Sp2, TomTom Navigator (According to the ApplicationVersion class) Major Version: 6; Minor Version: 0; Revision -1; Build 7370, TomTom SDK 6.010_7721 and Windows Mobile 5.
Cheers, all help gratefully and gladly received - thanks in advance!
Morris