Hello Erel,
thank you for your reply. I have checked my code.
No DoEvents and no modal dialog in my code. In the debugger I have found another problem:
Sub Service_Destroy
'Closes the window
If OW.IsInitialized Then
OW.Close
End If
Timersteuerung.Enabled=False
Gefahrton.Enabled=False
If gpsStarted Then
GPS1.Stop
gpsStarted = False
End If
If TTS1.IsInitialized = True Then TTS1.Release
End Sub
Sub BtnHide_Click
.
Awake.ReleaseKeepAlive
StopService("SvcOverlayInfo")
ExitApplication
End If
The command ExitApplication has prevented the execution of service_destroy. GPS1.Stop is not executed. Can this be the cause of the ANR error ?
I have moved now ExitApplication to the end of Service_Destroy.