Results 1 to 3 of 3

Thread: Registry

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 1999
    Location
    Kitchener Ontario Canada
    Posts
    20
    Hello, It would help a lot if anyone can tell me how i can simply retreive the "decimal" part of a "DWORD" value in the registry.,.,., i hope you know what i mean.,

    a DWORD value has "hexadecimal" and "decimal" parts to it,. and i would like to know how to retreive just the "decimal" part of the DWORD value and stick it in a text box.


    thanx to anyone who responds.....

    [Edited by aquarius on 04-01-2000 at 05:16 PM]

  2. #2
    New Member
    Join Date
    Mar 2000
    Location
    Kamloops BC Canada
    Posts
    7
    Hi

    I may not understand the question correctly but, the "decimal" part of a hex number is not "decimal" - it is a part of the complete hex number and a part of the complete numeric cycle (0 - 15 for hex) of that numbering system. The 'symbols' we are using to represent the numbers just happen to be the in the same form (from 0 to 9) in both numbering systems. I'm not sure what you end up with if you only extract the "decimal" portion. It isn't really a number in any numbering system I can think of. Changing the right most "decimal" number has a one to one correspondence from 0 - 9 but has no meaning to either system beyond that point.
    eg:

    (hex) 3A1D3 - by extracting the "decimal" part you would have 313, which has no correspondence to either numbering system. Going back to (hex) 3A1D3 and changing the leftmost "decimal" or center "decimal" number makes the number meaningless in both decimal and hex. Working towards the left, the columns in a hex number increase in powers of 16 and the decimal in powers of 10

    The thing to keep in mind is that a Hex number is not actually a number at all. It is only a representation of a binary number so that we can read it easier.

    I just re-read this and I don't think I am helping much if you don't have an understanding of the relationships
    between binary, hex and decimal.

    Dave

    [

    [Edited by d_yard on 04-01-2000 at 09:09 PM]

  3. #3
    Addicted Member
    Join Date
    Aug 1999
    Location
    Ottawa,ON,Canada
    Posts
    217
    I think I know where you're getting confused aquarius, I'm assuming that you're using Regedit to look at the values you want to retrieve. If this is what you're doing you probably see two numbers beside the Value you want to retrieve, one is the Hex number and the other, in brackets, is the Decimal equivalent. This does NOT mean that both numbers are stored in the Value, only the Hex numer is, Regedit conveniently converts that Hex value into its Decimal equivalent and places it into brackets beside it, this is only to help you view the data and does not actually save it in the Decimal form.

    Okay, long story short (a little late for that, eh ), if you use the RegQueryValueEx api function you can send a long variable in the lpData parameter to retrieve the DWORD data from the Value. The sweet part is that this function will automatically convert the Hex number to its Decimal equivalent when it is returned in the long variable. Convienent eh?

    I hope this is what you were looking for, if it isn't clear enough let me know and I'll be glad to elaborate.

    [

    [Edited by SonGouki on 04-01-2000 at 10:01 PM]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width