Device ID

Discussion in 'Questions (Windows Mobile)' started by mozaharul, Jan 11, 2009.

  1. mozaharul

    mozaharul Active Member Licensed User

    I have named the device (device ID) as "kdss_d1".
    In the database the device ID is saved as :
    "006F0050-0063-006B-0065-4850495041513231305F323433333700".
    How to get it back as "kdss_d1". I read the help but could not (might have missed) find exact function to do the same. Using Asc(hw.GetDeviceID) returns the device ID as "48".

    Please suggest me.


    regards,
     
  2. taximania

    taximania Well-Known Member Licensed User

    48 is the ASC value of 0, the first letter of your ID, you cant get the ASC value of a string.

    Try msgbox(hw.GetDeviceID)

    Edit: Ok, that doesn't work, just returns the string of numbers.
     
    Last edited: Jan 11, 2009
  3. agraham

    agraham Expert Licensed User

    The last segment of that string is the hex for "HPIPAQ210_24337". See the attached program. If you use this watch out for the zero character (00) at the end of the returned string which may be there as a string terminator.
    If you named the device in "About" that name is in the Registry under HKEY_LOCAL_MACHINE\Ident\Name
     

    Attached Files:

  4. mozaharul

    mozaharul Active Member Licensed User

    How the device name in "About" could be saved in SQLite database using Basic4PPC ?

    regards.
     
  5. agraham

    agraham Expert Licensed User

    Pick it out of the registry like I said above using the Registry library!
     
  6. mozaharul

    mozaharul Active Member Licensed User

    Since the same application will be used for more than 10 PDAs, so different device name will be there. How to pick out the different “REG_SZ” values ?
    Like:
    path="HKEY_LOCAL_MACHINE\Ident\Name"
    device_ID = reg.GetValue(PATH, REG_SZ)

    or like :
    device_ID = reg.GetValue(PATH, &REG_SZ)

    off course I have to initialize like:

    Sub App_Start
    reg.New1
    reg.RootKey(reg.rtLocalMachine)
    End sub


    regards.
     
  7. agraham

    agraham Expert Licensed User

    path="Ident"
    device_ID = reg.GetValue(path, "Name")
     
  8. mozaharul

    mozaharul Active Member Licensed User

    I appreciate your help.

    Best regards.
     
  9. taximania

    taximania Well-Known Member Licensed User

    Firstly your example fails, Variable j is assigned bla bla but not used
    comment this line out 'j=i
    It works.

    I added an Hardware object, hw
    and
    ID=hw.GetDeviceID

    The message box shows "" , nothing :confused:

    Don't waste time looking into it.
    I'm just pointing it out :sign0188:
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice