regenumkeyex problem

This is a discussion on regenumkeyex problem within the Windows Programming forums, part of the Platform Specific Boards category; i'm making a simple program to retvive some registery values of internet explorer but i'm stuck with the regenumkeyex function,in ...

regenumkeyex problem

i'm making a simple program to retvive some registery values of internet explorer but i'm stuck with the regenumkeyex function,in the code below the program should retvive the subkeys under internet explorer registery key (which is 21 keys) and add it to a combo box so the user choose which subkey he want to enter to change values in it but when i run the program only this values is added to the combo box
1-default html editor
2-desktop
3-desktop <----twice

so can you please tell me what is wrong with this code ? (why the "desktop" entry is cloned and why dosen't it retvive all the 21 subkeys)/

btw...i have some doubts about the second paramter in regenumkeyex function (the subkey index)

You doing the "m_combo.AddString (subkeys);" regardless of whether the "retsubkeys=RegEnumKeyEx(iesub,i,subkeys,&subsize, NULL,NULL,NULL,NULL );" actually succeeded or not, so that's why your getting an entry twice. Either use a while loop, or put another check in there before adding to the combo box.