Crash when zooming: System.OverflowException: Arithmetic operation resulted in an overflow.
Question:
My Tekla Structures is crashing continuously when I am zooming and moving in a model. The error message is:System.OverflowException: Arithmetic operation resulted in an overflow.
at SystemWindows.Shell.WindowsChromeWorker._HandleNCHitTest(WMuMsg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at SystemWindows.Shell.WindowsChromeWorker._WndProc(IntPtr hwnd, Int32 msg, intPtr wParam, intPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wparam, IntPtr IParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wparam, IntPtr IParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExcepuutionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchhandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, Intptr IParam)
Answer:
The crash happened when a Logitech mouse was customized with SetPoint or Options software.
This is a defect in Microsoft WPF. This crashing problem starts from Tekla Structures 2016 onwards. The problem appears mostly in Windows 7, and sometimes (but not often) in Windows 8.1 or Windows 10 operating systems. We have fixed this in the following versions:
- 2019 SP 7
- 2019i SP 5
- 2020 SP 1
Unfortunately the fix could not be moved to older versions, so the workaround solutions shown below still need to be used for those to avoid the crash:
One workaround solution is to uninstall the SetPoint/Options software, but if you don't want to uninstall those, you could try one of the workaround solutions below. If the crash is still happening with some other mouse button, try to change them to default one by one to find out which is causing a crash.
Solution 1:
Do not maximize the main window of Tekla Structures. That means the buttons in the upper right corner should look like this:
Solution 2:
Open Logitech SetPoint (or Logitech Options) Settings and make sure that Select Button list does not have any of the *Scroll tasks assigned to any button:
The tasks that can crash Tekla Structures are AutoScroll, Universal Scroll, Left Scroll, Right Scroll, and Horizontal scroll.
The last one, Horizontal scroll, may also cause a crash without an error message. See the linked article Changing mouse settings to avoid crash when zooming for information on how to change the horizontal scroll behavior of your mouse.
Solution 3:
If you want to keep the Left Scroll and Right Scroll tasks to work in other applications (e.g., a web browser) then:
1. Keep those tasks assigned to mouse buttons in the Mouse Button Settings tab
2. Open Advanced Settings tab, add Tekla Structures and make sure that there is no any *Scroll tasks in the Select Button list:
3. Click OK or Apply in the SetPoint Settings window to save settings.
You can find additional information about the application-specific button settings in the Logitech support site.