Sub com_listen
Dim d As Long
' // delay here for 1.5 seconds
d = DateTime.Add(DateTime.Now + (DateTime.TicksPerSecond * 1.5),0,0,0)
Do While d > DateTime.Now
DoEvents
Loop
Try
If Not(btCom.IsEnabled) Then
Log("com_listen() initialised")
btCom.Initialize("btCom")
End If
btCom.Listen
bCOMListening = True
Log(DateTime.time(DateTime.Now) & " Listening for Connection")
Catch
Log(DateTime.time(DateTime.Now) & " com_listen: " & LastException.Message)
StopService("")
End Try
End Sub