August 26th, 2010, 02:11 AM
First chance exception while updating a Chart control
I'm encountering a first chance exception (System.FormatException) while updating a Chart control. This exception isn't that evil as it is obviously caught somewhere and therefor doesn't terminate my app. But the exception messages in the debug output window are annoying a bit.
To be precise, it isn't only one exception, it are exactly 16 in a row. And as this is exactly the number of X axis labels in my chart, it is obvious that they are thrown while formatting these numbers. The numbers have been given the number format "X2" to output them as hex. According to MSDN, this format is only allowed for integral numeric types. And while they are actually ints in my app, they get implicitly converted to double when passed to DataPointCollection::AddXY(), and that causes the problem.
If there is a relatively easy way to get rid of this, please tell me. If it is complicated, then please give me a pointer into the right direction, but I think I will then get to live with the exception messages.
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!