I have written a C DLL and some C# code to test including this DLL and executing functions from it. I am not too familiar with this process, and am receiving a PInvokeStackI
In C++ a long is 32 bit. In C# it's 64 bit. Use int in your C# declaration.
long
int
You could also try adding __stdcall to the C++ function. See: What is __stdcall?
__stdcall