Hi folks,
I've recently updated an app that was written in vb6 many moons ago - this app is now being deployed on a 2008 server, and is running into problems accessing the system registry.

I was originally accessing the registry using:

Dim oReg as New Registry
oReg.getKeyValue(HKEY_LOCAL_MACHINE,<keypath>,<keyname>,"")

this returns nothing for the last parameter, which is meant to be the return type, suggesting that it cannot find the registry key. I have checked all the paths, multiple times over the last few hours, so im convinced that they are correct.

I then tried using regread by creating a Wscript.shell. This works only as far as reading a particular value on the HKLM node - any subnodes seem to throw up an error saying "Invalid root in registry Key".

At a bit of a loss on what to try now - it almost seems as if the HKLM constant within the Registry class in vb6 translates to a hex location that doesnt work with Windows 2008.

Lastly, I tried RegOpenKeyEx, but am struggling to figure out the 4th parameter - samDesired. As per MSDN, something like Key_READ should work, but vb6 doesnt seem to know the value of this - i have declared the function with advapi32.dll, so not sure if something else is needed to use RegOpenKeyEx?

Otherwise I'm out of ideas - is there anything else that can be done to access a windows 2008 registry setting from within VB6?

PS: thanks in advance...

Is there any other way to access the registry of a Windows 2008 machine, but through VB6?