Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading Registry DWORD

Status
Not open for further replies.

bonifale

Programmer
Sep 4, 2003
74
GB
I'm going mad here; been googling and hacking for ages.......

I'm trying to read the value of a REG_DWORD from the registry using VB2008. The word contains a timestamp which is the number of seconds elapsed since 12:00 a.m., Friday, January 1, 1904. and is set to hex:c6156000 (dec:3323289600)

Whenever I read it the value -971677696 is returned.

The class below represents what I'm trying to do and works okay if I use a REG_SZ value instead. Sadly I can't change the type as it's created by something else.

Any help greatly appreciated.

Public Class CalDate
Public Shared Sub Main()
Const userRoot As String = "HKEY_LOCAL_MACHINE"
Const subkey As String = "Software\MK3 ESR"
Const keyName As String = userRoot & "\" & subkey
Const value As String = "Cal Due Date"

Dim int_ans As Int32 = Registry.GetValue(keyName, value, 42)

End Sub
End Class

 
Just realised that the -971677696 value returned is in fact FFFFFFFFc6156000 which is the value I need but with the top two words set to FFFFFFFF.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top