Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- 0) extern "C" __declspec(dllexport)
- - - - - - - - - - - - - - - - - -
- 1) int (*_rr)();
- 2) HMODULE hDll = 0;
- 3) hDll = LoadLibrary("dll/for.dll");
- 4) _rr = (int(*)())GetProcAddress(hDll, "_rr");
- 5) FreeLibrary(hDll);
- */
- #include <stdio.h>
- #include <windows.h>
- HMODULE hDll = 0;
- int (*_foo)(int n);
- ////////////////////////////////////////////////////
- int main() //
- {
- hDll = LoadLibrary("F_dll/my.dll");
- printf("%d\n", hDll);
- _foo = (int(*)(int))GetProcAddress(hDll, "_foo");
- printf("_foo = %d\n", _foo);
- int nRes = _foo(2);
- printf("foo return %d", nRes);
- FreeLibrary(hDll);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement