extern "C" {
  #include <stdio.h>
  #include <stdlib.h>
  #include <Windows.h>
  
  
  HINSTANCE hin;
  HINSTANCE CONTROL_OPEN()
  {
    int (*open)();
    hin = LoadLibrary("C:\\LG\\ghub_device.dll");
    if (hin != NULL)
    {
      open = (int (*)())GetProcAddress(hin, "device_open");
      if (open != NULL)
      {
        open();
        return hin;
      }
      else
      {
        return 0;
      }
    }
  }
  void CONTROL_MOVE(int x,int y,bool abs_move)
  {
    void (*move)(INT, INT, BOOL);
    if (hin != NULL)
    {
      move = (void (*)(INT, INT, BOOL))GetProcAddress(hin, "moveR");
      if (move != NULL)
      {
        move(x, y, abs_move);
      }
    }
  }


}

#include <iostream>
int main()
{
  CONTROL_OPEN();
  CONTROL_MOVE(100,100,FALSE);
}

2022100404575928

作者 admin

发表评论

您的电子邮箱地址不会被公开。