I have this method exported from within a c++ project
#define EXTERN extern "C"
#define DLL_EXPORT __declspec(dllexport)
EXTERN DLL_EXPORT unsigned int BattleManager::ProcessBattleInEntityProcess() {
....
}
Using dumpbin i get the following mangled name for that method
?ProcessBattleInEntityProcess@BattleManager@Skill@Entity@@QAEHXZ
However, when i import the method in a .NET 4.5 project i get error 127
nativeCallbackName = "?ProcessBattleInEntityProcess@BattleManager@Skill@Entity@@QAEHXZ";
IntPtr _procAddress = NativeAPI.GetProcAddress(_nativeCallbackDLL, nativeCallbackName);
if (_procAddress == IntPtr.Zero)
{
Console.WriteLine("NULL ADDRESS for {0}", nativeCallbackName);
Console.WriteLine(Marshal.GetLastWin32Error());
return;
}
This is just some extracted code, other methods work just fine.