Scan for presence of GPS card

alfcen

Well-Known Member
Licensed User
Longtime User
Hi gang
Here is code by which I successfully scan presence of a CF type GPS card in iPAQ hx4700 h2200 Pocket PCs. Use or abuse at will :)

Sub ScanGPS
Dim i, v, cab, key, GPSPort
reg.RootKey(reg.rtLocalMachine)
key = "Drivers\Active\"
v=9
NotCreated:
v = i + 1
For i = v to 99
cab=key & Format(i,"D2")
ErrorLabel(NotCreated)
PnpID = reg.GetValue(cab, "PnpID")
if StrLength(PnpID) > 3 then
if StrIndexOf(StrToUpper(PnpID),"GPS",0)<>-1 then
GPSPort = SubString(reg.GetValue(cab, "Name"),3,1)
Return GPSPort
End if
End if
Next
End Sub
 
Top