I have probably the most basic setup possible, need to know why it is not working. A very simple C++ dll with a single method called Toast, one int in, with a return of int.
I also have a C# wrapper class with DLLImport function referencing the same
However when I run the deal, I get a nasty error about an unbalanced stack. Like the signature and return type of the wrapper don't match the DLL. Also if you continue through the exception the result comes back as expected.
Why would I be getting this message since the signations match? (return of int and one int in)
__declspec(dllexport) int Toast(int x)
return x + 100;
public static class Wrapper
[DllImport("File.dll", EntryPoint = "?Toast@@YAHH@Z")]
public static extern Int32 WR_TOAST(Int32 x);