Reading Registry Keys - Bug or Mistake?


Licensed User
I have written these lines:

Sub Globals
'Declare the global variables here.
Dim number, name, files(0) As string, binary(0) As byte
End Sub

Sub App_Start
number = reg.GetValue("Software\OEM", "SysLang") 'Number Of Items is of type REG_DWORD
name = reg.GetValue("Software\Comm", "AutoRun") 'User Name is of type REG_SZ
files() = reg.GetValue("Software\Drivers\BuiltIn", "IClass") 'Recent file is of type REG_MULTI_SZ (multi - string)
binary() = reg.GetValue("Software\AudioCompressionManager\Dri verCache\msacm.msg711","aFormatTagCache") 'BinaryValue is of type REG_BINARY

Msgbox(number, "DWORD")
Msgbox(name, "STRING")
Msgbox(files(), "MULTISTRING")
Msgbox(binary(), "BINARY")

End Sub

It comes given back the error to me of “key not found” on the reading of the DWORD; if I try to exclude the line, same thing for the STRING.
The stranger thing is that I have copied equal par the example of the Handbook; the only variation has been carried out on the path of the variable ones of the registry to read.
I have used one similar sintax in order to read keys on HKCU (rather than HKLM) without problems of risen… it is a bug or mistake something?
Thanks to anyone want to answer to me