Some VB if you can work it out from there!
Code:Public g_Dest As Object Private Sub Create_Click() Set g_Dest = CreateObject("DestDll.Dest") ', "Dest_") g_Dest.ParentWindow = hWnd res = g_Dest.CreateDestinatorWindow(F_DEFAULT) 'F_NOCAPTION + F_NOSYSMENU) ' + F_NOCONTROLS) '(F_DEFAULT) End Sub Private Sub Hide_Click() Dim res As Long res = g_Dest.HideDestinatorWindow() End Sub Private Sub Show_Click() Dim res As Long res = g_Dest.ShowDestinatorWindow() End SubCode:Dim WithEvents d As DESTDLLLib.Dest Dim Buf As DrumBuffer Dim Source As DrumBuffer Private Sub CloseComPOrt_Click() MSComm1.PortOpen = False d.SetGPSPortSource Nothing d.OpenGPSPort End Sub Private Sub Command1_Click() Dim dis As DESTDLLLib.DestPoint Set dis = New DESTDLLLib.DestPoint dis.Latitude = 40.4658 dis.Longtitude = -3.5937 dis.Description = "TestDis" Dim fName As String fName = "Wap" 'd.GetAddressFromCoordinates dis d.AddPointToFavoritFolder fName, dis 'MsgBox dis End Sub Private Sub ConnectGPS_Click() d.SetGPSPortTarget Buf Timer1.Enabled = True End Sub Private Sub d_OnDestinatorEvent(ByVal EventCode As Long) Debug.Print "d event = " & EventCode End Sub Private Sub DisconnectGPS_Click() Timer1.Enabled = False d.SetGPSPortTarget Nothing End Sub Private Sub Form_Load() Set d = New DESTDLLLib.Dest d.ParentWindow = hWnd Dim n As Long n = 26 'F_NOCAPTION Imp F_SHOW_ABOUT_DLG Imp F_SHOW_EXIT_DLG d.CreateDestinatorWindow 26 'd.ShowDestinatorWindow 'd.HideDestinatorWindow d.EnableTMC hWnd d.OnMapInformation = 15 n = d.VisualNotification Set Buf = New DrumBuffer Buf.SetSize 10000 Set Source = New DrumBuffer Source.SetSize 10000 Dim s As String Dim dis As DESTDLLLib.DestPoint Set dis = New DESTDLLLib.DestPoint dis.Latitude = 32.1613 dis.Longtitude = 34.80723 d.GetAddressFromCoordinates dis s = dis.Street d.MPRNavigate "GILI", 1 Dim nIndex As Long For n = 0 To d.CityCount If d.GetCityNameFromID(n) = "Ari'el" Then nIndex = n Next n Dim ar As DestIDArray 'Set ar = New DestIDArray Set ar = d.GetArrayOfStreetsIDForCity(nIndex) Dim nIndexMS As Long Dim nIndexME As Long Dim StreetID As Long For n = 0 To ar.ItemCount - 1 StreetID = ar.Item(n) If d.GetStreetNameFromID(StreetID) = "Tsahal" Then nIndexMS = StreetID If d.GetStreetNameFromID(StreetID) = "Barak" Then nIndexME = StreetID Next n Set dis = d.GetCoordinatesOfStreetIntersection(nIndex, nIndexMS, nIndexME) Debug.Print dis.Latitude 'Maneuver list Dim man As DESTDLLLib.DestManeuverList Set man = d.GetManeuverList 'Debug.Print "Distance=" & CStr(man.RouteDistance) Dim ManId As Long For n = 0 To man.ManeuverCount - 1 ' ManId = man.ManeuverID(n) s = man.CorrespondingStreetName(n) 'Debug.Print "Street=" & s & " Distance=" & man.DistanceToManeuver(n) Next n d.RemovePointFromFavoritFolder "eee", "fff" End Sub Private Sub Form_Unload(Cancel As Integer) 'd.ShowDestinatorWindow 'd.CreateDestinatorDialog DESTINATOR_EXIT_DLG Set Buf = Nothing Set Source = Nothing Set d = Nothing End Sub Private Sub MSComm1_OnComm() Dim s As Variant If MSComm1.CommEvent = comEvReceive Then s = MSComm1.Input Source.WriteData s End If End Sub Private Sub OpenCommPort_Click() d.CloseGPSPort d.SetGPSPortSource Source MSComm1.PortOpen = True End Sub Private Sub Timer1_Timer() Dim n As Long Dim ar() As Byte n = Buf.GetSize ar = Buf.ReadData(1) Dim s As String If UBound(ar, 1) > 0 Then Log.Text = Log.Text + vbNewLine For n = LBound(ar, 1) To UBound(ar, 1) If ar(n) <> 0 Then s = s + Chr(ar(n)) Next n Log.Text = s End If End Sub



LinkBack URL
About LinkBacks
Reply With Quote


Bookmarks