Scan for presence of GPS card

Discussion in 'Code Samples & Tips' started by alfcen, May 26, 2007.

  1. alfcen

    alfcen Well-Known Member Licensed 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
     
Loading...