Page 1 of 1

VB6 Integer overflow error

Posted: Thu Sep 08, 2005 5:47 pm
by 9083183
VB6, sp6 Tchart 6 ver 6.0.0.5

I'm having touble when I run the chart editor on an existing project. I just wanted to change the panel background. In any event, when I change anything and exit the editor, I get a VB 6 Integer overflow error.

This causes the chart to be rendered useless and forces load errors on the form when I load the project. (This is apparently what happened a few weeks ago when Narcis helped me reload a project.) I tried this on a second machine with the same issues.

Is this a known issue? Should I go to 6.0.0.6 or even v7?

Any suggestions on what else to look for?

David

Posted: Fri Sep 09, 2005 8:42 am
by narcis
Hi David,
I'm having touble when I run the chart editor on an existing project. I just wanted to change the panel background. In any event, when I change anything and exit the editor, I get a VB 6 Integer overflow error.
I'm not able to reproduce it here. This happens whenever changing anything with the chart editor? This happens at run-time, design-time or both?
This causes the chart to be rendered useless and forces load errors on the form when I load the project. (This is apparently what happened a few weeks ago when Narcis helped me reload a project.) I tried this on a second machine with the same issues.
This happens since you did what I suggested at your previous thread?

Posted: Fri Sep 09, 2005 11:47 am
by 9083183
Hi Narcis,
I'm not able to reproduce it here. This happens whenever changing anything with the chart editor? This happens at run-time, design-time or both?
This happens at design time only. After you helped me recover a couple weeks ago, I've made several changes to the program (not related to the charts in any way) with no incidents. Yesterday I tried to change the gradient on the chart panel and got the error. I went back to a previous version that worked (I'm getting more cautious in my old age) and got the same error trying to do the same thing. I also moved the source to a different machine with the same results. When it happened a couple weeks ago I am positive I made no changes at all to any of the 3 charts on the form. In fact I have not changed any of the charts for at least 4 months.
This happens since you did what I suggested at your previous thread?
Yes. The prior incident really caught me by surprise so I can't be sure what happened. I do know that I did get the same "Integer Overflow" error when I brought up the project in the IDE. I also got the load errors I told you about. That time all 3 charts were affected, this time only 1 of the 3. I had made no changes to the charts for several months although I had made several changes to the code for unrelated issues (field edits, general processing, etc. but nothing chart related).

This is very strange. This program has been around for a couple years with no incident until a couple weeks ago. I noticed that I can make a compiled version that executes properly even with the errors in the file. (Clear the Integer Overflow error and run a compile.)

Something is messed up and I'm not sure how to find it.

David

Posted: Fri Sep 09, 2005 1:49 pm
by narcis
Hi David,

It must still be a left-over from your previous problem. You could try removing the charts from your application, comment all code lines which call TChart, compile and run your application, place charts again on your forms, uncomment the code you previously commented and run the application again.

Posted: Tue Sep 20, 2005 8:51 pm
by 9083183
Narcis,

I've been trying to clear this problem by doing some of the things you suggested with mixed success. This is an intermittent problem which drives me crazy. Anyhow I think I've traced it back to when I added a rectangle shape series to the chart.

I never had the issue before that and I've never used a shape series before. I saved a version that seemed to be failing consistently and noticed that the position values in the editor were very large numbers for the top and bottom and extremely large negative numbers for the left and right. I changed them to something more reasonable and set the data source to manual.

It looks like the random numbers being created by the editor for this series were creating an out of range condition which caused an overflow error. Since the numbers were random, it didn't always fail but once it failed, it always failed when I reloaded.

I don't know if this is the problem but I haven't had any issues since and older versions that failed were corrected.

Note that I have always been able to generate a compiled version that worked properly even with the error in the IDE. That is why it only failed at design time.

Hopefully I have not jinxed myself by writing this memo. I just though it might be important.

David

Posted: Wed Sep 21, 2005 8:18 am
by narcis
Hi David,

These seems to be a different issue. There is a problem with shape series, which has been fixed for latest TeeChart releases. The workaround was populating shape series using FillSampleValues method just after adding them to the chart and before populating them with your desired data. However this may not be your problem.

Posted: Wed Sep 21, 2005 1:40 pm
by 9083183
Narcis,

Thanks for the help. Not sure if that was my problem or if I even described it properly. You mentioned that later versions had a fix for the shape series. From your description, maybe there is a connection. I'm using 6.0.0.5. Would 6.0.0.6 have the changes or do you mean V7?

I have a question about general coding practice for Tchart. In general, I've always added the series via the editor and then populated the chart through code by referring to the series number. It just seemed easier to set some of the basic settings with the editor. (I do change other options programmatically.)

I notice most of the examples actually add the series through code. Is one method preferred over another?

David

Posted: Wed Sep 21, 2005 2:22 pm
by narcis
Hi David,

Code: Select all

Thanks for the help. Not sure if that was my problem or if I even described it properly. You mentioned that later versions had a fix for the shape series. From your description, maybe there is a connection. I'm using 6.0.0.5. Would 6.0.0.6 have the changes or do you mean V7? 
I'd say it was not your exact problem but may have a connection. However it was fixed in v7.
I have a question about general coding practice for Tchart. In general, I've always added the series via the editor and then populated the chart through code by referring to the series number. It just seemed easier to set some of the basic settings with the editor. (I do change other options programmatically.)

I notice most of the examples actually add the series through code. Is one method preferred over another?
None of those methods is preferred above another. I agree it's easier setting the properties via the chart editor however some examples do almost everything at run-time so that users can figure out everything done in that example and they don't miss anything done with the editor. In that case it's easier for users to know the exact properties of the series, chart, etc.