Guest User

Untitled

a guest
Jun 24th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. extern "C" __declspec(dllexport) __cdecl int sum(int a,int b); ---->
  2.  
  3. using System.Runtime.InteropServices;
  4. namespace ImportDLL
  5. {
  6. public class importdll
  7. {
  8. public importdll()
  9. {
  10. }
  11.  
  12.  
  13. DllImport("mysum.dll",
  14. EntryPoint="sum",
  15. ExactSpelling=false,
  16. CallingConvention = CallingConvention.Cdecl)]
  17. public extern int myfun(int a, int b);
  18. }
  19. }
  20.  
  21. using ImportDLL;
  22. namespace TEST
  23. {
  24. public int my_result;
  25. protected importdll imp = new importdll();
  26. my_result = imp.myfun(1,1);
  27. }
Add Comment
Please, Sign In to add comment