Try this:
 Code:
Function ToHex($_V)

  Dim $_Hc					; hex charset
  Dim $_aD[0], $_aV				; array segments
  Dim $_Dv					; intermediate value
  Dim $_sH					; hex string

  $_Hc = '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'

  If VarType($_V) <> 5 Exit 87 EndIf		; must get a double!


  $_I = -1					; index pointer
  $_Dv = 1.0					; initial value
  While $_V > $_Dv				; determine required multipliers
    $_I = $_I + 1
    ReDim Preserve $_aD[$_I]
    $_aD[$_I] = $_Dv
    $_Dv = 256.0 * $_Dv
  Loop

  ; evaluate each hex octet and convert to a hex string
  For $_I = UBound($_aD) To 0 Step -1
    If $_V > $_aD[$_I]
      $_aV = Int($_V / $_aD[$_I])
      $_V = $_V - 1.0 * ($_aD[$_I] * $_aV)
      $_sH = $_sH + $_Hc[$_aV / 16] + $_Hc[$_aV Mod 16]
    Else
      $_sH = $_sH + '00'
    EndIf
  Next

  $ToHex = $_sH
  Exit 0

EndFunction
The function requires a double - either
 Code:
$V = 4048423081.0
ToHex($V) ?
or
 Code:
$V = '4048423081'
$V = CDbl($V)
ToHex($V) ?
It returns hex strings, not hex values. Since you're converting decimal to hex string to write to the registry, this should be fine. It seems to work fine with arbitrarily large numbers - I tested with small values and large values up to 750,000,000,000,000 (didn't test anything larger). I verified by using Calc in scientific mode.

It's imperative that it get a double-precision value.

If this works for you, I'll wrap it in a header and put it in the UDF section.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D