CUsbHelper.h #pragma once #include <windows.h> #include <atomic> extern "C" { #include <hidsdi.h> #include <setupapi.h> } #include "CTouchPadProtol.h" #define USB_READ_BUFFER_SIZE (1024 * 4) #define USB_WRITE_BUFFER_SIZE (1024 * 4) class CUsbHelper { public: CUsbHelper(); ~CUsbHelper(); CUsbHelper operator = (const CUsbHelper& r) = delete; //打开设备 bool Open(WORD wVID, WORD wPID); //是否打开 bool IsOpen(); //关闭设备 void Close(); //读取数据 bool Read(LPVOID lpBuffer, USHORT nNumberOfuint8_tsToRead,...