Device ID

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,
 

taximania

Well-Known Member
Licensed User
Longtime 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:

agraham

Expert
Licensed User
Longtime User
"006F0050-0063-006B-0065-4850495041513231305F323433333700"
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.
How to get it back as "kdss_d1"
If you named the device in "About" that name is in the Registry under HKEY_LOCAL_MACHINE\Ident\Name
 

Attachments

  • DeviceID.sbp
    761 bytes · Views: 256

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.
 

taximania

Well-Known Member
Licensed User
Longtime 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

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:
 
Top