SFML community forums
Bindings - other languages => DotNet => Topic started by: Spodi on April 24, 2010, 01:01:32 am
-
When upgrading my project to use .NET 4.0, I started suddenly getting a PInvokeStackImbalance exception (http://msdn.microsoft.com/en-us/library/0htdy0k3.aspx) on just about every PInvoke call to the SFML DLLs. Adding the named parameter:
CallingConvention = CallingConvention.Cdecl
giving you:
[DllImport("csfml-window", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
seems to fix it. Makes sense, since the default is StdCall. Other than getting rid of this annoying exception from the MDA (and the like 300x call overhead when MDA is enabled), everything else seems to behave just the same.
-
Sounds good, I'll apply the modification as soon as possible.
What is MDA?
-
It's done.
Thanks for your feedback.
-
MDA is the Managed Debugging Assistant, which is an extension of exceptions for when debugging via the IDE (I think...). It is tough to find much on it, but I think it may be from Visual Studio Team Edition. It seems to be mostly for checking that DLL calls are done correctly.
I honestly never even knew it existed until I started getting this exception.