I have written a VC++ dll. The declaration for one of the methods in the dll is as follows:
extern \"C\" _declspec(dllexport)
void startIt(int number)
{
When you p/invoke an external function, the calling convention used defaults to __stdcall. Since your function uses the __cdecl convention, you need to declare it as such:
[DllImport("Tracking.dll", EntryPoint = "startIt",
CallingConvention = CallingConvention.Cdecl)]
public extern static void startIt(int number);