Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include<iostream>
  2. #include<windows.h>
  3. #include<stdlib.h>
  4. #include <conio.h>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. long a = 2, b = 3;
  11. typedef long (_stdcall *controdiachi) (long, long);
  12. HINSTANCE thuvien;
  13. thuvien = LoadLibrary(TEXT("Dll.dll"));
  14. controdiachi Tich2so;
  15. if (thuvien == NULL)
  16. {
  17. cout<<"loi khong load duoc thu vien";
  18. getch();
  19. return 0;
  20. }
  21.  
  22. Tich2so = (controdiachi)GetProcAddress(thuvien, "Tich2so");
  23. if (Tich2so == NULL)
  24. {
  25. cout<<"loi khong goi duoc ham";
  26. getch();
  27. return 0;
  28. }
  29. cout<<Tich2so(a,b);
  30. FreeLibrary(thuvien);
  31. system("pause");
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement