SUGGESTION:
1) Run "dumpbin" on your .dll to confirm the problem is indeed name mangling.
2) If so, try the suggestion in this link:
Entry Point Not Found Exception
a) Use undname to get the undecorated name
b) Set EntryPointy == the mangled name
c) Set CallingConvention = CallingConvention.Cdecl
d) Use the unmangled name and signature for your C# method signature
See also this link:
http://bytes.com/topic/c-sharp/answers/428504-c-program-calling-c-dll
Laurent.... You can call the function using the mangled name as in:
To call a function using its fully decorated name
"?fnWin32Test2@@YAJXZ"
as"Win32Test2" you can specify the static entry point as
"?fnWin32Test2@@YAJXY":
[DllImport("Win32Test.dll", EntryPoint= "?fnWin32Test2@@YAJXZ")] public static extern int fnWin32Test2();
And call it as:
System.Console.WriteLine(fnWin32Test2());
To look at the undecorated name use the undname tool as in:
`undname ?fnWin32Test@@3HA`
This converts the decorated name to "long fnWin32Test".
Regards, Jeff