There are some programs in C++

Qt Code:
  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <windows.h>
  4. #include "AtUsbHid.h"
  5.  
  6. using namespace std;
  7.  
  8. int main(int argc, char *argv[])
  9. {
  10. HINSTANCE hLib = NULL;
  11. hLib =LoadLibrary(AT_USB_HID_DLL);
  12. if(hLib == NULL){
  13. cout << "boing\n";
  14. }
  15. loadFuncPointers(hLib);
  16.  
  17. DYNCALL(findHidDevice)(Vid, Pid);
  18. DYNCALL(hidRegisterDeviceNotification)((m_hWnd));
  19.  
  20. system("PAUSE");
  21. return EXIT_SUCCESS;
  22. }
To copy to clipboard, switch view to plain text mode 

This realization is already on the QT. What am I doing wrong?

Qt Code:
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3. #include <QLibrary>
  4. #include <QMessageBox>
  5. #include <cstdlib>
  6. #include <stdio.h>
  7. #include <conio.h>
  8. #include <windows.h>
  9. #include <stddef.h>
  10. #include <windowsx.h>
  11.  
  12. // Include Atmel Hid Usb
  13. #include "AtUsbHid.h"
  14.  
  15. #define DEFAULT_VID 0x03EB
  16. #define DEFAULT_PID 0x2013
  17.  
  18.  
  19.  
  20. MainWindow::MainWindow(QWidget *parent) :
  21. QMainWindow(parent),
  22. ui(new Ui::MainWindow)
  23. {
  24. ui->setupUi(this);
  25.  
  26. }
  27.  
  28. MainWindow::~MainWindow()
  29. {
  30. delete ui;
  31.  
  32. Vid = DEFAULT_VID;
  33. Pid = DEFAULT_PID;
  34. }
  35.  
  36.  
  37.  
  38. void MainWindow::on_ConnectUsb_clicked()
  39. {
  40. QLibrary hLib(AT_USB_HID_DLL);
  41. hLib.load();
  42.  
  43. if (!hLib.load())
  44. {
  45. QMessageBox::warning(this, tr("Error"),
  46. tr("Not found AtUsbHid.dll"),
  47. return;
  48. }
  49. //***********************************************************
  50. typedef void (*func)();
  51. func PF_findHidDevice = (func) hLib.resolve("findHidDevice)(Vid, Pid)");
  52. if (!PF_findHidDevice)
  53. {
  54. qDebug ("!!!!!!!!findHidDevice");
  55. return;
  56. }
  57.  
  58.  
  59. typedef void (*func)();
  60. func PF_hidRegisterDeviceNotification = (func) hLib.resolve("hidRegisterDeviceNotification");
  61. if (!PF_hidRegisterDeviceNotification)
  62. {
  63. qDebug ("!!!!!!!!hidRegisterDeviceNotification");
  64. return;
  65. }
  66. //***********************************************************
  67. }
To copy to clipboard, switch view to plain text mode