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# long
means 64 bit int while in C++ long means 32 bit int, you need to change your pinvoke declaration to
[DllImport("LibNonthreaded.dll", EntryPoint = "process")]
public unsafe static extern void process( int high, int low);
You could also try changing your C++ declaration to stdcall, that's the calling convention used by most exported functions in the Windows environment.
__stdcall __declspec(dllexport) void process( long high, long low );