RegEnumValue : Not able to retreive registry value for Date format..
-
Hi, Can anybody tell me why am I not getting Value's data in below code, in buffer 'pszRegValData' ? The surprising thing is that I am able to receive other value's data in it which has REG_SZ datatype... but the value for which it's not giving any output has REG_SZ as a datatype too.. data for it is "04/26/2007 10:20:01".. It's not giving me data in buffer(pszRegValData) for REG_BINARY too... retCode = RegEnumValue(hkScanKey, i, szRegValueName, &dwRegValNameLen, NULL, &dwRegValType, (LPBYTE)pszRegValData, &dwRegValLen); Thanks in advance. regards, Supriya Tonape
-
Hi, Can anybody tell me why am I not getting Value's data in below code, in buffer 'pszRegValData' ? The surprising thing is that I am able to receive other value's data in it which has REG_SZ datatype... but the value for which it's not giving any output has REG_SZ as a datatype too.. data for it is "04/26/2007 10:20:01".. It's not giving me data in buffer(pszRegValData) for REG_BINARY too... retCode = RegEnumValue(hkScanKey, i, szRegValueName, &dwRegValNameLen, NULL, &dwRegValType, (LPBYTE)pszRegValData, &dwRegValLen); Thanks in advance. regards, Supriya Tonape
also the error code I get is '234' though I am making sure that buffer has enough size to hold the returned data...
-
also the error code I get is '234' though I am making sure that buffer has enough size to hold the returned data...
Supriya Tonape wrote:
also the error code I get is '234'...
Which is not an error, but means that more data is available.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
Supriya Tonape wrote:
also the error code I get is '234'...
Which is not an error, but means that more data is available.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
thanks for the reply. But I am already making sure that buffer size is enough to store the data...by API 'RegQueryInfoKey()' I am getting max length of value's data.. I am executing it before 'RegEnumValue()' and allocating the buffer for value (length returned by 'RegQueryInfoKey' + 1)... still why 234 error ? :(
-
thanks for the reply. But I am already making sure that buffer size is enough to store the data...by API 'RegQueryInfoKey()' I am getting max length of value's data.. I am executing it before 'RegEnumValue()' and allocating the buffer for value (length returned by 'RegQueryInfoKey' + 1)... still why 234 error ? :(
Supriya Tonape wrote:
...still why 234 error ? :(
It's not an error, but means that more data is available.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
thanks for the reply. But I am already making sure that buffer size is enough to store the data...by API 'RegQueryInfoKey()' I am getting max length of value's data.. I am executing it before 'RegEnumValue()' and allocating the buffer for value (length returned by 'RegQueryInfoKey' + 1)... still why 234 error ? :(
I just traced my code and found that for every character it's taking 2 bytes.. and I am allocatiing buffer as per length returned by 'RegQueryInfoKey' which returned length of longest value data... for example actual date string/data(REG_SZ) length is 20 but when 'RegEnumValue' gets the date string/data, the length returned is 40(in last param of 'RegEnumValue').... So I doubled my buffer's size but still it gives me same problem... any suggestions ? I am running my 'console' appln on 32 bit intel proc with 32-bit XP OS on it...
-
I just traced my code and found that for every character it's taking 2 bytes.. and I am allocatiing buffer as per length returned by 'RegQueryInfoKey' which returned length of longest value data... for example actual date string/data(REG_SZ) length is 20 but when 'RegEnumValue' gets the date string/data, the length returned is 40(in last param of 'RegEnumValue').... So I doubled my buffer's size but still it gives me same problem... any suggestions ? I am running my 'console' appln on 32 bit intel proc with 32-bit XP OS on it...
awaiting for reply..
-
awaiting for reply..
I resolved the prob, after each call we need to set the data buffer size back to max value length... sadly this is not quoted in MSDN! it's hard to understand whats going on wrong in code when MSDN says everytime 'RegEnumValue' iterates thru reg values,it returns the data length... I wasted my night for this silly problem...
-
I resolved the prob, after each call we need to set the data buffer size back to max value length... sadly this is not quoted in MSDN! it's hard to understand whats going on wrong in code when MSDN says everytime 'RegEnumValue' iterates thru reg values,it returns the data length... I wasted my night for this silly problem...