manishmenghani
Apr 26th, 2001, 04:22 AM
Hey Guys ,
I m stucked in a problem while using RegQueryValueEx API . the problem is like , In My registry in a key there are 5 data values . I want to retrieve these values . I m calling the regQueryValueEx 5 times to get the value from the key .
But the problem is that sometimes it gives me successful results in 3 key , sometimes in 4 key . However I ve values in all the keys
Is there a bug in RegQueryValueEx or if u know any alternate of it then pls help me .
my code goes ike this :
lRetVal = RegQueryValueEx(hKey, COMM_PORT, 0, lType, ByVal sTemp, sLength)
If lRetVal = ERROR_SUCCESS Then
sCommPort = Left(sTemp, sLength - 1)
End If
lRetVal = RegQueryValueEx(hKey, BAUD_RATE, 0, lType, ByVal sTemp, sLength)
If lRetVal = ERROR_SUCCESS Then
sBaudRate = Left(sTemp, sLength - 1)
End If
lRetVal = RegQueryValueEx(hKey, DATA_BITS, 0, lType, ByVal sTemp, sLength)
If lRetVal = ERROR_SUCCESS Then
sDataBits = Left(sTemp, sLength - 1)
End If
lRetVal = RegQueryValueEx(hKey, PARITY_BITS, 0&, lType, ByVal sTemp, sLength)
If lRetVal = ERROR_SUCCESS Then
sParity = Left(sTemp, sLength - 1)
End If
lRetVal = RegQueryValueEx(hKey, STOP_BITS, 0, lType, ByVal sTemp, sLength)
If lRetVal = ERROR_SUCCESS Then
sStopBits = Left(sTemp, sLength - 1)
End If
I m stucked in a problem while using RegQueryValueEx API . the problem is like , In My registry in a key there are 5 data values . I want to retrieve these values . I m calling the regQueryValueEx 5 times to get the value from the key .
But the problem is that sometimes it gives me successful results in 3 key , sometimes in 4 key . However I ve values in all the keys
Is there a bug in RegQueryValueEx or if u know any alternate of it then pls help me .
my code goes ike this :
lRetVal = RegQueryValueEx(hKey, COMM_PORT, 0, lType, ByVal sTemp, sLength)
If lRetVal = ERROR_SUCCESS Then
sCommPort = Left(sTemp, sLength - 1)
End If
lRetVal = RegQueryValueEx(hKey, BAUD_RATE, 0, lType, ByVal sTemp, sLength)
If lRetVal = ERROR_SUCCESS Then
sBaudRate = Left(sTemp, sLength - 1)
End If
lRetVal = RegQueryValueEx(hKey, DATA_BITS, 0, lType, ByVal sTemp, sLength)
If lRetVal = ERROR_SUCCESS Then
sDataBits = Left(sTemp, sLength - 1)
End If
lRetVal = RegQueryValueEx(hKey, PARITY_BITS, 0&, lType, ByVal sTemp, sLength)
If lRetVal = ERROR_SUCCESS Then
sParity = Left(sTemp, sLength - 1)
End If
lRetVal = RegQueryValueEx(hKey, STOP_BITS, 0, lType, ByVal sTemp, sLength)
If lRetVal = ERROR_SUCCESS Then
sStopBits = Left(sTemp, sLength - 1)
End If