Click here to Skip to main content
15,909,445 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC Chart Pin
Coremn23-Mar-05 16:53
Coremn23-Mar-05 16:53 
GeneralOpenGL and CView problem Pin
FayezElFar23-Mar-05 11:50
FayezElFar23-Mar-05 11:50 
GeneralRe: OpenGL and CView problem Pin
Alexander M.,23-Mar-05 12:19
Alexander M.,23-Mar-05 12:19 
GeneralRe: OpenGL and CView problem Pin
FayezElFar24-Mar-05 4:25
FayezElFar24-Mar-05 4:25 
GeneralSimple error, but how to solve?:( Pin
sacoskun23-Mar-05 10:01
sacoskun23-Mar-05 10:01 
GeneralRe: Simple error, but how to solve?:( Pin
PJ Arends23-Mar-05 10:09
professionalPJ Arends23-Mar-05 10:09 
GeneralRe: Simple error, but how to solve?:( Pin
sacoskun23-Mar-05 10:21
sacoskun23-Mar-05 10:21 
GeneralRe: Simple error, but how to solve?:( Pin
Barry Etter23-Mar-05 10:39
Barry Etter23-Mar-05 10:39 
GeneralRe: Simple error, but how to solve?:( Pin
sacoskun23-Mar-05 10:43
sacoskun23-Mar-05 10:43 
GeneralRe: Simple error, but how to solve?:( Pin
Barry Etter23-Mar-05 10:53
Barry Etter23-Mar-05 10:53 
GeneralRe: Simple error, but how to solve?:( Pin
PJ Arends23-Mar-05 10:55
professionalPJ Arends23-Mar-05 10:55 
GeneralRe: Simple error, but how to solve?:( Pin
sacoskun23-Mar-05 11:15
sacoskun23-Mar-05 11:15 
GeneralRe: Simple error, but how to solve?:( Pin
Serge Krynine23-Mar-05 11:54
Serge Krynine23-Mar-05 11:54 
GeneralRe: Simple error, but how to solve?:( Pin
sacoskun23-Mar-05 18:13
sacoskun23-Mar-05 18:13 
GeneralNeed some direction Pin
Tom Wright23-Mar-05 9:55
Tom Wright23-Mar-05 9:55 
GeneralRe: Need some direction Pin
PJ Arends23-Mar-05 10:59
professionalPJ Arends23-Mar-05 10:59 
GeneralRe: Need some direction Pin
Tom Wright23-Mar-05 11:21
Tom Wright23-Mar-05 11:21 
Questionneed a tool (or api) that creates login attempts to an active directory domain?? Pin
vista2723-Mar-05 9:25
vista2723-Mar-05 9:25 
AnswerRe: need a tool (or api) that creates login attempts to an active directory domain?? Pin
Blake Miller23-Mar-05 11:43
Blake Miller23-Mar-05 11:43 
QuestionHow to detect Network Cable Unplug Events Pin
Paolo Ponzano23-Mar-05 8:36
Paolo Ponzano23-Mar-05 8:36 
AnswerRe: How to detect Network Cable Unplug Events Pin
David Crow23-Mar-05 9:45
David Crow23-Mar-05 9:45 
GeneralHardware list error Pin
brilliant10123-Mar-05 8:10
brilliant10123-Mar-05 8:10 
GeneralRe: Hardware list error Pin
David Crow23-Mar-05 9:47
David Crow23-Mar-05 9:47 
Put a breakpoint on the SetupDiCreateDeviceInfoList() statement and single-step through the code until you get to the statement that causes the error.

I cleaned up your code a bit to look like:

HDEVINFO DoDeviceEnum( void )
{
    GUID        InterfaceClassGuid;
    HDEVINFO    DeviceInfoSet,
                NewDeviceInfoSet;
 
    DeviceInfoSet = SetupDiCreateDeviceInfoList(&InterfaceClassGuid, NULL);
    if (DeviceInfoSet != INVALID_HANDLE_VALUE) 
    {
        NewDeviceInfoSet = SetupDiGetClassDevsEx(&InterfaceClassGuid, 
                                                 NULL, 
                                                 NULL, 
                                                 DIGCF_PRESENT | DIGCF_DEVICEINTERFACE, 
                                                 DeviceInfoSet, 
                                                 NULL,
                                                 NULL);
 
        if (NewDeviceInfoSet != INVALID_HANDLE_VALUE) 
            ; // do something with the list
        else
            printf("SetupDiGetClassDevsEx failed: %lu.\n", GetLastError());
 
        SetupDiDestroyDeviceInfoList(DeviceInfoSet);
    }
    else
        printf("SetupDiCreateDeviceInfoList failed: %lu.\n", GetLastError());
 
    return NewDeviceInfoSet;
}
 
void main( void )
{
    DoDeviceEnum();
}



"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow


GeneralSocket programming Pin
vinsankar23-Mar-05 6:55
vinsankar23-Mar-05 6:55 
GeneralRe: Socket programming Pin
greba23-Mar-05 7:44
greba23-Mar-05 7:44 

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.