I'm trying to use native c++ dll inside a c# application.
I followed this article to get started.
Its working fine while the dll using only c files (like in the tutorial), but when using cpp files I cant make it work.
using the dumpbin tool I can see that my exported function names changed. for example a function call 'next' changed to '?next@@YAHH@Z' and when I'm trying to call it in the c# code it cant find it.
my dll code is:
__declspec(dllexport)
int next(int n)
{
return n + 1;
}
the c# code
[DllImport("lib.dll", CallingConvention = CallingConvention.Cdecl)]
extern static int next(int n);
its the same code while using c file or cpp files
Thanks in advance Amichai