Bonsoir
A la la suite de cette discution j'ai essaye de tester un cable convertisseur USB //
J'ai donc recupere des exemples et commence les testes, je n'ai aucune erreur mais mon HDEVINFO et systematiquement negatif, je ne vois pas ou se trouve l'erreur voici le code
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include <setupapi.h> // ne pas oublier
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
// ClassGuid  {36FC9E60-C465-11CF-8056-444553540000}
GUID GUID_DEVINTERFACE_USBPRINT = {0x36FC9E60, 0xC465, 0x11CF, {0x80, 0x56, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}};
HDEVINFO hDevInfo;
GUID hIdGuid;
  hIdGuid = GUID_DEVINTERFACE_USBPRINT;
  hDevInfo = SetupDiGetClassDevs(&hIdGuid, NULL, NULL, (DIGCF_PRESENT | DIGCF_DEVICEINTERFACE));
        if (hDevInfo == INVALID_HANDLE_VALUE)
        {
        return; // je passe systematiquement ici
        }
}
//---------------------------------------------------------------------------