G
Garry
I use the following VB6 code to get a registry value.
lngValueSize = 256
gstrKeyValue = Space(lngValueSize)
lngStatus = RegQueryValueEx(lngSubkeyHandle, Trim$(strSubKey), 0,
lngValueType, ByVal gstrKeyValue, lngValueSize)
RegGetKeyValueP = ""
If lngStatus = 0 Then
If lngValueSize > 0 Then
If lngValueType = REG_SZ Then
RegGetKeyValueP = Left$(gstrKeyValue,
lngValueSize - 1)
Else
RegGetKeyValueP = Trim$(gstrKeyValue)
End If
End If
End If
The lngValueType returned is 1 which is REG_SZ but the gstrKeyValue is not
a Null Terminated string and so the value has its end lopped off. ie.
"6744553' is returned as "674455". The code works fine on WIN XP and all
previous standard versions of Windows.
Anyone know wot the problem is????
Garry
lngValueSize = 256
gstrKeyValue = Space(lngValueSize)
lngStatus = RegQueryValueEx(lngSubkeyHandle, Trim$(strSubKey), 0,
lngValueType, ByVal gstrKeyValue, lngValueSize)
RegGetKeyValueP = ""
If lngStatus = 0 Then
If lngValueSize > 0 Then
If lngValueType = REG_SZ Then
RegGetKeyValueP = Left$(gstrKeyValue,
lngValueSize - 1)
Else
RegGetKeyValueP = Trim$(gstrKeyValue)
End If
End If
End If
The lngValueType returned is 1 which is REG_SZ but the gstrKeyValue is not
a Null Terminated string and so the value has its end lopped off. ie.
"6744553' is returned as "674455". The code works fine on WIN XP and all
previous standard versions of Windows.
Anyone know wot the problem is????
Garry