Click here to Skip to main content
15,887,214 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHandling KeyDown even on Dialog. Pin
grassrootkit27-Mar-09 18:49
grassrootkit27-Mar-09 18:49 
AnswerRe: Handling KeyDown even on Dialog. Pin
Stuart Dootson27-Mar-09 23:41
professionalStuart Dootson27-Mar-09 23:41 
GeneralRe: Handling KeyDown even on Dialog. Pin
grassrootkit28-Mar-09 4:46
grassrootkit28-Mar-09 4:46 
GeneralRe: Handling KeyDown even on Dialog. Pin
Stuart Dootson28-Mar-09 4:59
professionalStuart Dootson28-Mar-09 4:59 
GeneralRe: Handling KeyDown even on Dialog. Pin
grassrootkit28-Mar-09 5:39
grassrootkit28-Mar-09 5:39 
Questionvs2008proeditiongodaytrialedition Pin
samuellhu27-Mar-09 17:09
samuellhu27-Mar-09 17:09 
AnswerRe: vs2008proeditiongodaytrialedition Pin
grassrootkit27-Mar-09 18:50
grassrootkit27-Mar-09 18:50 
QuestionAnnoying RegEnumKeyEx Problem Pin
Baltoro27-Mar-09 6:49
Baltoro27-Mar-09 6:49 
I am writing an application that enumerates all the subkeys in HKEY_CLASSES_ROOT\CLSID, and then writes all the names of subkeys to an XML file for reference.
It's pretty simple stuff, really. This registry location stores configuration information for all the registered COM classes on my machine, and there are about 4.000 subkeys.
Each subkeys Name is the hexadecimal string representation of a 128-bit number known as a Globally Unique Identifier (GUID). When represented textually, GUIDs are always displayed in the following canonical form:

BDA4A270-A1B1-11D0-8C2C-0080C73925BA

The HKEY_CLASSES_ROOT\CLSID subkeys are named exactly like this, except that they begin and end with curly braces.
I enumerate the subkeys with a simple for loop, saving the GUID to a TCHAR buffer (size, 128 bytes) and everyting works OK, until I hit a subkey about a third of the way down that is a GUID with one of the integers missing. Then the RegEnumKeyEx function stops writing the GUIDs to the TCHAR buffer, but continues on without generating an error code.
The program code then writes the GUID text strings to my XML file (this part works great).
I had to write another function that uses RegEnumKeyEx in a for loop again, but indexes the enumeration to begin at the subkey immediately after the truncated GUID that caused the problem initially, and runs to the final key (total subkey count obtained with RegQueryInfoKey). This works successfully. but the entire process of the determining the source of the error, and writing a seperate enumeration function was quite time consuming (I initially thought it was insufficient memory.).
I'm wondering if anyone knows why RegEnumKeyEx behaves like this. Surely, it doesn't check the text GUID values for validity. I used Registry Editor to search for other keys and associated values for that one malformed GUID, and found about a dozen entries, all with the same exact truncated format (weirdly enough, it's a Visual Studio component!).
Any useful comments are appreciated,...thanks.
QuestionRe: Annoying RegEnumKeyEx Problem Pin
David Crow27-Mar-09 8:10
David Crow27-Mar-09 8:10 
AnswerRe: Annoying RegEnumKeyEx Problem Pin
Baltoro27-Mar-09 11:37
Baltoro27-Mar-09 11:37 
GeneralRe: Annoying RegEnumKeyEx Problem Pin
Baltoro27-Mar-09 12:02
Baltoro27-Mar-09 12:02 
GeneralSorry, all the text is running off the page display. Pin
Baltoro27-Mar-09 12:37
Baltoro27-Mar-09 12:37 
GeneralRe: Sorry, all the text is running off the page display. Pin
David Crow30-Mar-09 2:50
David Crow30-Mar-09 2:50 
GeneralRe: Annoying RegEnumKeyEx Problem Pin
krmed28-Mar-09 3:41
krmed28-Mar-09 3:41 
GeneralThanks! [modified] Pin
Baltoro28-Mar-09 11:11
Baltoro28-Mar-09 11:11 
QuestionDynamic controls Pin
grassrootkit27-Mar-09 4:30
grassrootkit27-Mar-09 4:30 
AnswerRe: Dynamic controls Pin
David Crow27-Mar-09 5:02
David Crow27-Mar-09 5:02 
GeneralRe: Dynamic controls Pin
grassrootkit27-Mar-09 5:21
grassrootkit27-Mar-09 5:21 
GeneralRe: Dynamic controls Pin
David Crow27-Mar-09 5:24
David Crow27-Mar-09 5:24 
GeneralRe: Dynamic controls Pin
grassrootkit27-Mar-09 7:32
grassrootkit27-Mar-09 7:32 
QuestionRe: Dynamic controls Pin
led mike27-Mar-09 5:24
led mike27-Mar-09 5:24 
QuestionRe: Dynamic controls Pin
David Crow27-Mar-09 5:26
David Crow27-Mar-09 5:26 
AnswerRe: Dynamic controls Pin
led mike27-Mar-09 6:25
led mike27-Mar-09 6:25 
AnswerRe: Dynamic controls Pin
Maximilien27-Mar-09 6:09
Maximilien27-Mar-09 6:09 
Questionwhats wrong with ontimer function? Pin
Aljaz11127-Mar-09 2:31
Aljaz11127-Mar-09 2:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.