This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I'm using WPF elements 5.1. I irregularly get “Negating the minimum value of a twos complement number is invalid” exception while the graph is updating. But I cannot find anything wrong in my line series data. And I find some news update in Mindscape Bolg, it says: "Resolved a potential “Negating the minimum value of a twos complement number is invalid” exception." in WPF elements 6.0. Is it means that the only way to avoid this exception is to update to 6.0? What's the reason of this exception? Is there anything I can do to resolve it if I currently cannot update to 6.0? Any help is doing me a great favor! thanks. Below if the exception information: Message=Negating the minimum value of a twos complement number is invalid Source=mscorlib StackTrace: System.Math.AbsHelper(Int32 value) System.Math.Abs(Int32 value) Mindscape.WpfElements.Charting.ChartAxis.#8qc() Mindscape.WpfElements.Charting.ChartAxis.#4qc() System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) System.Windows.Threading.DispatcherOperation.InvokeImpl() System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) System.Threading.ExecutionContext.runTryCode(Object userData) System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) System.Windows.Threading.DispatcherOperation.Invoke() System.Windows.Threading.Dispatcher.ProcessQueue() System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) System.Windows.Threading.Dispatcher.Run() System.Windows.Application.RunDispatcher(Object ignore) System.Windows.Application.RunInternal(Window window) System.Windows.Application.Run(Window window) System.Windows.Application.Run() |
|
|
Hello Yaron This bug was caused by a Math.Abs operation being applied to a value that was set to Double.MinValue. This issue was actually originally resolved in version 5.1 back in August 20th. The stack trace you posted seems to point to the same problem. Try grabbing the latest nightly build of version 5.1 to see if this resolves the issue. If the problem remains, please send me a repro project so I can track down this bug and fix it for you in version 5.1. We still support version 5.1 but of course not as much as version 6.0. It would be best to upgrade to version 6 as soon as you can to gain a years worth of bug fixes, features and performance improvements. Upgrading is free. There are just some minor breaking changes that you'll need to account for which you can read about in the Getting Started -> What's New section of the 6.0 help file. Look for the "Breaking changes in WPF Elements 6.0" heading. I can help you if you have any questions about breaking changes. Jason Fauchelle |
|
|
Hello Jason: Thanks for your reply. But I'm not sure whether I'm using the latest nightly build of 5.1 version (I'm not able to get the build from your website currently). How can I identify whether I'm with the latest build? In the Windows OS->Control panel-> Add or Remove Programs, I got the version of Mindscape WPF Elements is 5.1.0.0. Does the latest nightly build make update on this version information when it's installed? If yes, what's the corresponding version number of the latest nightly build? Thanks! |
|
|
Hello Yaron No, the version in Control Panel does not get updated. I've added this to our backlog. To get the version number, find the dll, right click this and select Properties. Click the Details tab and you'll see the full version number listed there. The latest nightly build is #5.1.2279.22984. The problem should have been solved in version 5.1.x.22889. So if the last number in your version is higher than 22889, then there may be another problem, otherwise it means you don't have a build with the fix for this bug. I hope you can get the latest nightly soon. What is preventing you from downloading it? Jason Fauchelle |
|
|
Thanks Jason, I've checked the number of dll file. It's lower than 22889. I'm not with the latest one. As I'm using a team license, I don't have the customer account, I'll tell my workmate to get the latest one. Thank you. |
|
|
Hi Jason, In the download page in your website, I cannot find any nightly build for 5.1 version. There is only a "The latest release" with 5.1 version (lower than 22889). But there are "The latest nightly build" for 5 version and 6 version. Are you sure the nightly build you mentioned is for 5.1 version? Or is this nightly build limited for some specific account? |
|
|
Hello Yaron Apologies for the misleading names. You'll want the latest nightly build next to version 5. There is not really supposed to be a 5.1 section. Jason Fauchelle |
|
|
Sorry, I'm a little bit confused. So which version is this nightly build based on? 5 or 5.1? I'm using 5.1 release in my project, Is it OK to install this build for my project? If it's based on 5 version which is a lower version to the one in my project, there is going to be some problems, isn't it? |
|
|
In the downloads page in the store account, version 5.1 is considered to be the latest version 5. So the nightly build under the section that says version 5 is in fact the latest 5.1 version which is what you'll want. This is confusing because there is also a section called 5.1, but you can ignore that one. You'll want to download the latest nightly build from the section that says version 5. Sorry for the confusion here. Jason Fauchelle |
|
|
Jason, Thanks very much for your in time reply. I've downloaded the latest nightly build for version 5. But it seems does not work on my existing project. I'm using System.Data.DataTable as the ItemsSource of my SplineSeries. It works fine with 5.1 release, but not work when I switch to nightly build of version 5. It seems hang up when I add a new row into the bound DataTable, while it goes fine with 5.1 version installed. Then I modify my code to use ObservableCollection |
|
|
Hello Yaron With the latest version of 5.1, I couldn't actually get a chart working with a DataTable at all. The reason for this is there was a significant performance improvement made to the charts a while ago in version 5.1 which had a sideeffect of only allowing simple XBinding and YBinding to work. This was later resolved in version 6.0. I've back ported this from 6.0 to 5.1 for you. This will be available in the next nightly build (available in about 14 hours from now). I was unable to reproduce the freezing, so I'm not certain this will fix the issue, but it's the only thing I can think that would be affecting your scenario. If the problem remains after you get the next nightly build, please send me a demo project. Also, please consider upgrading to version 6.0 soon as support for version 5.1 will diminish when we release version 7.0 next year. Jason Fauchelle |
|
|
Hello Jason, After some tests, it turns out that the version is not the truth. The exception keep alive even with 6.0 version. So I went back to check my code again. I found the reason: I bind the ItemsSource of the line to DataTable as you have known. Each time I append data to the table, I can only fill part of the columns. It means for some rows in the table, there are some columns does not have values. For example: My table has 4 columns: x1,y1,x2,y2. they are bound to two lines as two set of X/y axis. and during the process, I fill data to the table only with one pair of columns for each time. this will cause the table have a row with two columns not assigned values: For this scenario, the exception will be triggered when I adjust the Maximum value of x axis. And if I set the blank cell with some default value (for example 0), the exception disappeared, (but for the business logic of my project, these is no proper default value before the real data coming). So Jason, do you have any clue on this kind of scenario? Is it not supported at all? Or is there any solution for it? |
|
|
Updated the example image. |
|
|
Hello Yaron This scenario should be supported. I've tried this out but didn't run into any exceptions after updating the X maximum. Could you please send a repro project demonstrating this issue, then I'll work out what's wrong. Jason Fauchelle |
|
|
Hello Jason: I've uploaded a zip file named "TheDemoProject.zip". (please ignore the "Demo.zip" one,I just cannot delete it). It contains a demo project and a text file. I've added some description for the project in the text file. Please help me to find what's is going on. Thanks a lot. |
|
|
Thanks for the repro project. I will be looking into this tomorrow. -Jason Fauchelle |
|
|
Hello Unfortunately I don't know much about Prism, so I was unable to run the demo project correctly. I downloaded Prism and referenced the appropriate dlls, but when I run the application, I just see a responsive but blank window. I assume I need to correct the paths in the Bootstrapper, but not sure what they should be. In any case, I took your view and model and recreated a simple WPF application that doesn't use prism. I removed the prism specific parts and rather than using the event aggregator, I use the dispatcher and a delegate to marshal the refreshGraph call to the UI thread. When running this up, every thing works fine. I see the red and black line appear and update one at a time - 1 second pause between updates on average. I have reattached your solution containg a new project (GraphTest) which is my plain WPF reconstruction of your demo. Please try this out on your machine with the WPF Elements dll your have. If you still see the problem, then you probably have an old version of WPF Elements. Otherwise, if it runs fine, then the problem must only be present when using Prism. If that is the case, please let me know any thing I need to do to run your Prism project on my machine. Thanks -Jason Fauchelle |
|
|
Hello Jason: Sorry for not making the demo project as simple as needed. I've made a new demo project based on your solution. I deleted my original two projects and keep the one you added. I did not modify anything on the code. And I'm using Mindscape with 6.0.2165.22593 version. Below is the steps what I took to reproduce the exception:
Hope it works this time. Thanks a lot. |
|
|
Hello Yaron Thanks for the new repro project. It still works fine on my machine with the latest version of WPF Elements. The version number you mentioned is about 8 months old. The person who owns the store account will need to go to the store account page and find the WPF Elements 6.0 section. Here there will be 2 links, one of them is under a title that says "Latest Nightly Builds". The link text will have (roughly) today's date. This is the one you'll want which works great with binding a DataTable to chart series. The latest version should roughly be 6.0.2629.23104. -Jason Fauchelle |
|
|
Hello Jason: I've tried the latest nightly build of 6.0 version. It works fine in both the demo project and my original project. So it turns out that all the other versions are with issues on the this kind of cases. So do I have to update to this latest nightly build any way? or you can provide a corresponding patch for 5.1 version? Or any other solutions? |
|
|
Hello Yaron I was going to back-port this capability to version 5.1 for you, but there are too many parts that need to change to get this working correctly, so I will be unable to do this. You will need to upgrade your project to use the latest nightly build of version 6.0. This would be best anyway, as support for version 5.1 will diminish next year. Let me know if you have any questions about upgrading to version 6.0. -Jason Fauchelle |
|