Joe,
RegQueryValueEx needs the key handle stored in the lphKey call from the RegOpenKeyEx(). Not HKEY_CURRENT_USER like you are sending it. Once you open a key you use that handle to read/write it until you close the key.
>ret = RegOpenKeyEx(HKEY_CURRENT_USER, sKeyName, 0, 0, @lphKey)
>ret = RegSetValueEx(@lphKey, sDataName, 0, 1, sDataValue, lLen)
> nCurrentKey = HKEY_CURRENT_USER
> nErrCode=RegQueryValueEx(nCurrentKey,cValueName,;
> lpdwReserved,@lpdwType,@lpbData,@lpcbData)