Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern "C" __declspec(dllexport) __cdecl int sum(int a,int b); ---->
- using System.Runtime.InteropServices;
- namespace ImportDLL
- {
- public class importdll
- {
- public importdll()
- {
- }
- DllImport("mysum.dll",
- EntryPoint="sum",
- ExactSpelling=false,
- CallingConvention = CallingConvention.Cdecl)]
- public extern int myfun(int a, int b);
- }
- }
- using ImportDLL;
- namespace TEST
- {
- public int my_result;
- protected importdll imp = new importdll();
- my_result = imp.myfun(1,1);
- }
Add Comment
Please, Sign In to add comment