'Dim wsh As IWshShell_Class
Dim strLatKey, strLonKey, strAltKey 

'Set wsh = New IWshShell_Class
Set wsh = CreateObject("WScript.shell")
strLatKey = "HKCU\Volatile Environment\DiGLELatitude"
strLonKey = "HKCU\Volatile Environment\DiGLELongitude"
strAltKey = "HKCU\Volatile Environment\DiGLEAltitude"
strSpeedKey = "HKCU\Volatile Environment\DiGLESpeedKnots"
strFoundNewKey = "HKCU\Volatile Environment\DiGLELastFndNew"
strSeenBeforeKey = "HKCU\Volatile Environment\DiGLELastSeenBefore"
strLostContactKey = "HKCU\Volatile Environment\DiGLELastLostContact"
strBestSNRKey = "HKCU\Volatile Environment\DiGLELastBestSNR"
strBFiveKey = "HKCU\Volatile Environment\DiGLELastBestHope"
strGPSStatusKey = "HKCU\Volatile Environment\MusatchaGPSStatus"

Public Function OnScanComplete(FoundNew , SeenBefore, LostContact,  BestSNR) 
	wsh.RegWrite strFoundNewKey,  FoundNew, "REG_SZ"
	wsh.RegWrite strSeenBeforeKey, SeenBefore, "REG_SZ"
	wsh.RegWrite strLostContactKey, LostContact, "REG_SZ"
	wsh.RegWrite strBestSNRKey, BestSNR, "REG_SZ"
	wsh.RegWrite strBFiveKey, "Sheridan", "REG_SZ"
End Function

Public Function OnGPSTimeout()
	wsh.RegWrite strLatKey, "0.00", "REG_SZ"
	wsh.RegWrite strLonKey, "0.00", "REG_SZ"
	wsh.RegWrite strAltKey, "0.00", "REG_SZ"
	wsh.RegWrite strSpeedKey, "0.00", "REG_SZ"
	wsh.RegWrite strGPSStatusKey, "timeout", "REG_SZ"
End Function

Public Function OnGPSNoFix()
	wsh.RegWrite strLatKey, "0.00", "REG_SZ"
	wsh.RegWrite strLonKey, "0.00", "REG_SZ"
	wsh.RegWrite strAltKey, "0.00", "REG_SZ"
	wsh.RegWrite strSpeedKey, "0.00", "REG_SZ"
	wsh.RegWrite strGPSStatusKey, "nofix", "REG_SZ"
End Function

Public Function OnGPSPosition(Latitude, Longitude, Altitude) 
	wsh.RegWrite strLatKey, Latitude, "REG_SZ"
	wsh.RegWrite strLonKey, Longitude, "REG_SZ"
	wsh.RegWrite strAltKey, Altitude, "REG_SZ"
	wsh.RegWrite strGPSStatusKey, "ok", "REG_SZ"
End Function

Public Function OnGPSSpeed(Speed)
	wsh.RegWrite strSpeedKey, Speed, "REG_SZ"
End Function