My WPF test app (very simple, just one window) is using a 3rd party managed dll (say X.dll). This managed dll uses some unmanaged dll\'s . So lets say I write a small wpf a
Following the link from @Mishhl the fix is
public class FloatingPointReset
{
[DllImport("msvcr110.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int _fpreset();
public static void Action()
{
// Reset the Floating Point (When called from External Application there was an Overflow exception)
_fpreset();
}
}
It's caused by something in an included DLL resetting the FP into a state that isn't compatible with WPF/C#/Microsoft DLL's. Delphi/CPPB does this by default.
So in either the window constructor or App() constructor just do
FloatingPointReset.Action();
You may need to change the following to reference any version of msvcr###.dll
[DllImport("msvcr110.dll", CallingConvention = CallingConvention.Cdecl)]
e.g.
[DllImport("msvcr70.dll", CallingConvention = CallingConvention.Cdecl)]