Hello, I am retreiving the DWORD from the registry using this code
VB Code:
Function GetSettingLong(ByVal Hkey As Long, ByVal strPath As String, ByVal strValueName As String, Optional Default As Long) As Long Dim lResult As Long Dim lValueType As Long Dim lBuf As Long Dim lDataBufSize As Long Dim r As Long Dim keyhand As Long r = RegOpenKey(Hkey, strPath, keyhand) lDataBufSize = 4 lResult = RegQueryValueEx(keyhand, strValueName, 0&, lValueType, lBuf, lDataBufSize) If lResult = ERROR_SUCCESS Then If lValueType = REG_DWORD Then GetSettingLong = lBuf End If End If r = RegCloseKey(keyhand) End Function
This works perfectly on most machines that runs this function, however on an Windows XP machine this always returns 0. Even though on other XP machines this works perfectly on this XP machine it does not work even though lResult has the value ERROR_SUCCESS.
I have looked directly in the registry and the values are there, I have sucessfully retreived REG_SZ values from that XP machine but for some reason it does not reterive the DWORD for this machine.
The only difference I see is that it is a French version of windows. Any ideas anybody?




Reply With Quote