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

C / C++ / MFC

 
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 
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 
David Crow,
Sorry, I can't get at the edit control to change the last post. You're probably laughing, it's such a ridiculous post. You will notice that the test expression in the for loop is: dwClsidIndx <= 1488
Well, I changed that value after the loop initially failed (at CLSID number 1488). it originally was 3965 (which is the value returned from RegQueryInfoKey, dwNumSubKeys).
You will also notice that I begin the enumeration at value 1, instead of zero, as recommended by the documentation. This is because, I was getting the same name "CLSID" written to the TCHAR ComClssGuid [128] buffer, 3965 times (each time the loop executed).
The code just preceeding the loop, where I obtain the hKey value is here:
	DWORD dwNumBubKeys = 0 ;    
	DWORD dwMaxSubLen = 0 ;    
	DWORD dwSize = 128 ;   
	FILETIME ftLastWrtTime ;  
	HKEY hRootKey = NULL ;    
    const TCHAR ComClsidEntrs [] = TEXT("CLSID") ;   
	LPCTSTR ClsidKeys = ComClsidEntrs ;    
    RegOpenKeyEx (HKEY_CLASSES_ROOT, ClsidKeys, 0, KEY_ALL_ACCESS, &hRootKey) ;    
	RegQueryInfoKey (hRootKey, NULL, NULL, NULL, &dwNumBubKeys, &dwMaxSubLen, NULL, NULL, NULL, NULL, NULL, NULL) ;   
	DWORD dwRetVal = 0 ;    
//  ERROR_SUCCESS = 0              ERROR_MORE_DATA = 234       
//  There is an error at number 1488. The CLSID entry is missing an integer.   
//  The following loop fails to write GUIDs after that point. Reason unknown.     

	for (DWORD dwClsidIndx = 1 ; dwClsidIndx <= 3965 ; dwClsidIndx++)    
	{    
	TCHAR ComClssGuid [128] ;    
	ZeroMemory (&ComClssGuid, 128) ;     
	LPTSTR pComClsid = ComClssGuid ;    
	dwRetVal = RegEnumKeyEx (hRootKey, dwClsidIndx, ComClssGuid, &dwSize, NULL, NULL, NULL, &ftLastWrtTime) ;       
	if ((dwRetVal != ERROR_SUCCESS) && (dwRetVal != ERROR_MORE_DATA))    
	{    
    dwRetErrorVal = dwRetVal ;    
	dwErrNumClsid = dwClsidIndx ;    
	dwClsidErrors++ ;    
	TCHAR ErrorMessage [192] ;   
	wsprintf (ErrorMessage, TEXT("    ERROR: Number of Errors: %lu. ERROR: CLSID %lu. Error Code: %lu"), dwClsidErrors, dwErrNumClsid, dwRetErrorVal) ;    
    SetStatusMessage (ErrorMessage) ;    
	return FALSE ;    
	}    
    WriteClsidNodesAlpha (ClsidDomDoc, pDocRtElment, pComClsid, dwClsidIndx) ;     
	}    


Really, it's more of an annoyance than anything, since I was able to correct the problem. I'm just curious as to why it happened.
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 
QuestionRe: whats wrong with ontimer function? Pin
David Crow27-Mar-09 2:55
David Crow27-Mar-09 2:55 
AnswerRe: whats wrong with ontimer function? Pin
Aljaz11127-Mar-09 5:59
Aljaz11127-Mar-09 5:59 
QuestionLPTSTR problem Pin
zakkas248327-Mar-09 0:41
zakkas248327-Mar-09 0:41 

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.