so i'm trying to read in values from the registry and add them to a dropdown list for the user to select one. i've created a loop to add the values to the list, but for some reason it only reads in the initial value.? so if i initialize my counter to 0, it reads in the key indexed at 0, if i initialize it to 1, it reads in the key indexed at 1, etc. i know it doesn't get caught in an infinite loop, because it goes through the loop the correct number of times (yes i'm adhd and wanted to repeat myself (not literally)). it baffles me here's the code:so uh...anyone know whats wrong? lolCode:do { regresult = RegEnumKeyEx(hkey, counter, data, &size, 0, 0, 0, 0); if (regresult != ERROR_NO_MORE_ITEMS) SendMessage(GetDlgItem(hwnd, ID_CMBBOX), CB_ADDSTRING, 0, (LPARAM)(LPCSTR)data); //counter = counter+1; //counter += 1; ++counter; i = 0; /* if i dont null out the string, the original value gets added X number of times..? */ while (data[i] != 0) { data[i] = 0; } } while (regresult != ERROR_NO_MORE_ITEMS);
btw, the one value that DOES get read in, IS added to the dropdown list.