I have this code in two programs. In one program it works perfectly.
On the other program (same machine) the result is 234 at the first reading. Keeping the program turned on and quering the same function will not return an error and read the details as needed.
templong = RegQueryValueEx(hKey,