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 31
| #include <iostream> #include <windows.h> #include "PipeIPC/PipeIPC.h"
int main() { std::cout << "--- DLL Test ---\n";
HINSTANCE hDLL; using Face = int * (*)(int,int);
hDLL = LoadLibrary(L"mydll.dll"); if (hDLL != NULL) { Face faceSum = (Face)GetProcAddress(hDLL, "mySum");
if (!faceSum) { FreeLibrary(hDLL); return 0; } else { faceSum(1,1); } } return 0; }
|