Page 1 of 1

Problem when unloading forms containing TChart control

Posted: Tue Jul 08, 2008 2:32 am
by 15047738
Hi,

We are currently experiencing some problems when unloading forms that contain TChart controls. We are using TChart in a VB6 environment and we have done nothing in the code other than replace the v6 TChart object with the v8 TChart control object.

Specifically, we have 2 forms loaded (FormA and FormB) each of which contains a TChart control.

FormA has a Form_Unload event which unloads FormB:
...
...
Private Sub Form_Unload(Cancel As Integer)
Unload FormB
End Sub
...
...

If FormB has the focus and we close FormA (by clicking the default Close button at the top right of FormA), FormA's Form_Activate event is triggered during FormA's Form_Unload event.

Previous to upgrading to the v8 TChart control, FormA's Form_Activate event was not triggered for the scenario described above. This has been observed with both TeeChart8.ocx and TeeChart8Langs.ocx

Any assistance would be greatly appreciated.

Thanks,
Ross

Posted: Tue Jul 08, 2008 8:05 am
by narcis
Hi Ross,

Could you please arrange a simple example project we can run "as-is" to reproduce the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.

Posted: Tue Jul 08, 2008 11:45 pm
by 15047738
Hi NarcĂ­s,

Thanks for your prompt reply. Ross has asked me to provide you with an example project that demonstrates the problem we are experiencing.

I have uploaded an example project to your upload page as directed. The name of the file is FormUnloadBug.zip

If you unzip and run the example project:

1. Click Command1 on the main form to load FormA and FormB (FormB should have the focus)
2. Immediately click the close button at the top left of FormA which is in the background behind FormB

You should get an error message displayed which is related to execution of code within FormA's Form_Activate event. It appears that FormA's Form_Activate event has been triggered whilst in the middle of FormA's Form_Unload event.

This has been observed with both TeeChart8.ocx and TeeChart8Langs.ocx but was not observed with TeeChart6.ocx

Please let me know if you need more information.

Best Regards,
Raymond Oreo

Posted: Wed Jul 09, 2008 8:47 am
by yeray
Hi Raymond and Ross,

Yes, you are right. Something strange is happening here. I've added it to the wish list to be investigated asap. (TA05013203)

Posted: Wed Jul 09, 2008 10:46 pm
by 15047738
Thanks Yeray.

Best Regards,
Ray Oreo