A call to PInvoke function 'TestFunction!TestFunction.Program::xvid_global' has unbalanced the stack

引用第三方组件,出现上述问题解决方法:

可以试一下指定一个Call Convention:

        [DllImport("xvidcore.dll", CallingConvention=CallingConvention.Cdecl)]
        private extern static int xvid_global(IntPtr handle, int opt, IntPtr param1, IntPtr param2);

原文地址:https://www.cnblogs.com/glj1203/p/2029102.html