共计 532 个字符,预计需要花费 2 分钟才能阅读完成。
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); }
正文完