Thursday, October 18, 2012

C# PInvoke MDA error, stack imbalance

Issue with MDA PInvoke error, stack imbalance. even though had checked to make sure that the parameters match the DLL method signature.

Learnt from Mark that have to add an additional parameter.

[DllImport("somelibrary.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int methodName(string parameter);