RegEnumValue problems.
-
I wrote my code in VB(It is hell but i had not choice), but it does not work. I keeps returning error 234 (ERROR_MORE_DATA). But i have a 12 Kb buffer, which means the problems is something else. Please Help. I am already 3 hours in this &^&%&%.:mad::mad::mad:
-
I wrote my code in VB(It is hell but i had not choice), but it does not work. I keeps returning error 234 (ERROR_MORE_DATA). But i have a 12 Kb buffer, which means the problems is something else. Please Help. I am already 3 hours in this &^&%&%.:mad::mad::mad:
HAHAHA_NEXT wrote: I keeps returning error 234 (ERROR_MORE_DATA). But i have a 12 Kb buffer, which means the problems is something else. You failed to indicate what API you are using that is producing this "error." In any case, it's obvious that a 12KB buffer is insufficient. Try a larger number.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
-
I wrote my code in VB(It is hell but i had not choice), but it does not work. I keeps returning error 234 (ERROR_MORE_DATA). But i have a 12 Kb buffer, which means the problems is something else. Please Help. I am already 3 hours in this &^&%&%.:mad::mad::mad:
ERROR_MORE_DATA is not really an error. It simply means that there are more values to enumerate. RegEnumValue does not enumerate *all* values, you give it a counter, and it enumerates one at a time. For instance (yes, this is C++ code, but you can figure out the algorithm):
DWORD error; DWORD index = 0; TCHAR nameBuff[1024]; TCHAR valueBuff[1024]; DWORD nameBuffSize, valueBuffSize; DWORD type; do { nameBuffSize = valueBuffSize = 1024; error = ::RegEnumValue(hSectionKey, index, nameBuff, nameBuffSize, 0, &type,(BYTE *)valueBuff, &valueBuffSize); if(error == ERROR_SUCCESS || error == ERROR_MORE_DATA) { // do something with the enumerated value } index++; } while(error == ERROR_SUCCESS || ERROR == ERROR_MORE_DATA);
Sometimes I feel like I'm a USB printer in a parallel universe. -
ERROR_MORE_DATA is not really an error. It simply means that there are more values to enumerate. RegEnumValue does not enumerate *all* values, you give it a counter, and it enumerates one at a time. For instance (yes, this is C++ code, but you can figure out the algorithm):
DWORD error; DWORD index = 0; TCHAR nameBuff[1024]; TCHAR valueBuff[1024]; DWORD nameBuffSize, valueBuffSize; DWORD type; do { nameBuffSize = valueBuffSize = 1024; error = ::RegEnumValue(hSectionKey, index, nameBuff, nameBuffSize, 0, &type,(BYTE *)valueBuff, &valueBuffSize); if(error == ERROR_SUCCESS || error == ERROR_MORE_DATA) { // do something with the enumerated value } index++; } while(error == ERROR_SUCCESS || ERROR == ERROR_MORE_DATA);
Sometimes I feel like I'm a USB printer in a parallel universe.I think i found it. Stupid vb does not understand NULLS.
-
ERROR_MORE_DATA is not really an error. It simply means that there are more values to enumerate. RegEnumValue does not enumerate *all* values, you give it a counter, and it enumerates one at a time. For instance (yes, this is C++ code, but you can figure out the algorithm):
DWORD error; DWORD index = 0; TCHAR nameBuff[1024]; TCHAR valueBuff[1024]; DWORD nameBuffSize, valueBuffSize; DWORD type; do { nameBuffSize = valueBuffSize = 1024; error = ::RegEnumValue(hSectionKey, index, nameBuff, nameBuffSize, 0, &type,(BYTE *)valueBuff, &valueBuffSize); if(error == ERROR_SUCCESS || error == ERROR_MORE_DATA) { // do something with the enumerated value } index++; } while(error == ERROR_SUCCESS || ERROR == ERROR_MORE_DATA);
Sometimes I feel like I'm a USB printer in a parallel universe.I think i found it. Stupid vb does not understand NULLS.
error = ::RegEnumValue(hSectionKey, index, nameBuff, nameBuffSize, 0, NULL,NULL,NULL);
Does not work with VB (&^%$^^&^%&) :mad:. Thank you all. I changed my code and it works now.