Click here to Skip to main content
15,892,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: LINK error1181:Cann't open input file "Gx.obj" Pin
Rage6-Aug-07 5:42
professionalRage6-Aug-07 5:42 
QuestionImage comparision Pin
Maynka6-Aug-07 4:03
Maynka6-Aug-07 4:03 
QuestionRe: Image comparision Pin
David Crow6-Aug-07 4:06
David Crow6-Aug-07 4:06 
Questionhiding a window below another control window Pin
prithaa6-Aug-07 3:48
prithaa6-Aug-07 3:48 
AnswerRe: hiding a window below another control window Pin
baerten6-Aug-07 4:07
baerten6-Aug-07 4:07 
AnswerRe: hiding a window below another control window Pin
KarstenK6-Aug-07 4:08
mveKarstenK6-Aug-07 4:08 
Questionenumerate the subkey in registry [modified] Pin
retinex6-Aug-07 3:43
retinex6-Aug-07 3:43 
QuestionRe: enumerate the subkey in registry Pin
David Crow6-Aug-07 3:48
David Crow6-Aug-07 3:48 
Please modify your post by surrounding the code snippet with <pre> tags.

How is RegEnumSubKeys() initially called?

What is RegOpen()?

I assume you know of the missing comma in the function's parameter list.

Have you considered simplifying your code to something like:

LONG RegEnumSubKeys( HKEY hStartKey, LPCTSTR lpszStartKey )
{
    LONG    retCode;
    HKEY    hSubKey;
    TCHAR   szKeyName[MAX_PATH];
    int     i = 0;
 
    retCode = RegOpenKeyEx(hStartKey, lpszStartKey, 0, KEY_READ, &hSubKey);
    if (ERROR_SUCCESS == retCode)
    {
        while (ERROR_SUCCESS == retCode)
        {
            DWORD dwMaxSubKey = MAX_PATH;
 
            retCode = RegEnumKeyEx(hSubKey,
                                   i++,
                                   szKeyName,
                                   &dwMaxSubKey,
                                   NULL,
                                   NULL,
                                   NULL,
                                   NULL);
        
            if (ERROR_NO_MORE_ITEMS == retCode)
                break;
            else if (ERROR_SUCCESS == retCode)
                retCode = RegEnumSubKeys(hSubKey, szKeyName);
        }
 
        retCode = RegCloseKey(hSubKey);
    }
 
    return retCode;
}



"A good athlete is the result of a good and worthy opponent." - David Crow

"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne


AnswerRe: enumerate the subkey in registry Pin
retinex6-Aug-07 15:56
retinex6-Aug-07 15:56 
GeneralRe: enumerate the subkey in registry Pin
David Crow6-Aug-07 16:18
David Crow6-Aug-07 16:18 
GeneralRe: enumerate the subkey in registry Pin
retinex6-Aug-07 20:50
retinex6-Aug-07 20:50 
QuestionLegacy Code with VS 2005 Pin
Andy2026-Aug-07 3:28
Andy2026-Aug-07 3:28 
QuestionRe: Legacy Code with VS 2005 Pin
David Crow6-Aug-07 3:41
David Crow6-Aug-07 3:41 
AnswerRe: Legacy Code with VS 2005 Pin
Andy2026-Aug-07 4:43
Andy2026-Aug-07 4:43 
AnswerRe: Legacy Code with VS 2005 Pin
cp98766-Aug-07 13:58
cp98766-Aug-07 13:58 
QuestionHow to debug a shortcut to the application Pin
PravinSingh6-Aug-07 3:20
PravinSingh6-Aug-07 3:20 
AnswerRe: How to debug a shortcut to the application Pin
toxcct6-Aug-07 3:22
toxcct6-Aug-07 3:22 
GeneralRe: How to debug a shortcut to the application Pin
PravinSingh6-Aug-07 3:40
PravinSingh6-Aug-07 3:40 
QuestionConsole in MFC Pin
baerten6-Aug-07 2:43
baerten6-Aug-07 2:43 
QuestionRe: Console in MFC Pin
David Crow6-Aug-07 3:46
David Crow6-Aug-07 3:46 
AnswerRe: Console in MFC Pin
baerten6-Aug-07 4:05
baerten6-Aug-07 4:05 
QuestionHow To Obtain IP Adress of a Yahoo Messenger Chatter Pin
Pallab_GT6-Aug-07 2:41
Pallab_GT6-Aug-07 2:41 
AnswerRe: How To Obtain IP Adress of a Yahoo Messenger Chatter Pin
Nelek6-Aug-07 3:00
protectorNelek6-Aug-07 3:00 
GeneralRe: How To Obtain IP Adress of a Yahoo Messenger Chatter Pin
Hamid_RT6-Aug-07 8:59
Hamid_RT6-Aug-07 8:59 
AnswerRe: How To Obtain IP Adress of a Yahoo Messenger Chatter Pin
David Crow6-Aug-07 3:49
David Crow6-Aug-07 3:49 

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.