Urgent: Teechart 2010 tchart.h problem

TeeChart for ActiveX, COM and ASP
Post Reply
David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Urgent: Teechart 2010 tchart.h problem

Post by David » Fri Jan 21, 2011 7:12 am

I included tchart.h in two headers files that are both included in a cpp file, and when compiling, an error occured: "error C2011: 'CTChart' : 'class' type redefinition". I compared the 2010 version of tchart.h and v8 tchart. h and noticed that the

#if !defined(AFX_TCHART_H__1C6F492E_029C_4867_A215_0D740BEDCFD5__INCLUDED_)
#define AFX_TCHART_H__1C6F492E_029C_4867_A215_0D740BEDCFD5__INCLUDED_

is missing in 2010 version tchart.h, which I think could be the cause of the problem. So would anyone please check it out and suggest an solution to it?

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Re: Urgent: Teechart 2010 tchart.h problem

Post by David » Sun Jan 23, 2011 2:52 pm

Would anyone please give some suggestions? It is really urgent.

In each of the two header files, I declared a CTChart varialbe and when I included both in a cpp, the compile error occurs.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Urgent: Teechart 2010 tchart.h problem

Post by Sandra » Mon Jan 24, 2011 11:40 am

Hello David,

Could you send us a simple project we can run as-is to reproduce the problem here? On the other hand, can you tell us if demos of VC++ Activex 2010 work fine for you?

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Re: Urgent: Teechart 2010 tchart.h problem

Post by David » Mon Jan 24, 2011 2:30 pm

Attached is the test program that will generate the error. It is a VS2008 project. In the testView.cpp, I included two header files

#include "Chart1.h"
#include "Chart2.h"

The error occured when I compiled it. Also, when I opened the demo project "Add data arrays" using vs2008 and compiled it, quite some errors occured, but not the same error as mine, maybe it is because the installed folder is not the default one since I installed it to "C:\Program Files\TeeChart Pro v2010 ActiveX Control". I haven't worked on other demo projects yet.

Please do let me know any update asap. Thanks.
Attachments
test.zip
(61.02 KiB) Downloaded 848 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Urgent: Teechart 2010 tchart.h problem

Post by Sandra » Tue Jan 25, 2011 12:44 pm

Hello David,

I could reproduce your error here, but we need that you confirm us, if it Error appears in Demo projects VC++ or these work fine for you.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Re: Urgent: Teechart 2010 tchart.h problem

Post by David » Tue Jan 25, 2011 2:28 pm

I tried to open the projects under Visual C++\version 6\ with VS2008, and after the conversion to VS2008, the adding data arrays and drag points demo had errors when I tried to open the resource to check the dialog. The error screens are attached. I reinstalled ver2010 again and the problems remained. When I tested the demo under Examples\Visual Studio .NET\Vc++\Dragging Points using VS2008, the same error occured.
Attachments
Dragging.JPG
Dragging.JPG (15.42 KiB) Viewed 19076 times
AddingArray.JPG
AddingArray.JPG (15.04 KiB) Viewed 19067 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Urgent: Teechart 2010 tchart.h problem

Post by Sandra » Thu Jan 27, 2011 1:28 pm

Hello David,

Once solved, the problem of Demos in VC++ by coping the classes of Activex2010\Utilities\New vcl Classes to the root folder of demo examples. We need if it possible, you send the same project with VC++ 2008 in VC++ 6 so we try to solve the problem, converting of VC++ 6 project to VC++ 2008.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Re: Urgent: Teechart 2010 tchart.h problem

Post by David » Fri Jan 28, 2011 3:11 pm

I could follow what you want. Would you please list what you want me to do step by step? Also, I am not sure if you are addressing my initial problem, which is the erro of redefinition of CTChart class when two header files that both include tchart.h are included in the same cpp file.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Urgent: Teechart 2010 tchart.h problem

Post by Sandra » Fri Jan 28, 2011 3:46 pm

Hello David,

Could you please try creating a similar project in VC++ 6 instead of VS2008? The idea is to get it working in VC++ 6 and then let VS2008 upgrade it automatically.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Re: Urgent: Teechart 2010 tchart.h problem

Post by David » Sat Jan 29, 2011 3:32 pm

First of all, I don't have VC6. Secondly, even if I had VC6, I don't think it is acceptable to build future projects in VC6 first and convert to VS2008. Thirdly, I have been using Teechart 8 for a long time in VS2008 and everything worked fine, so I really think there is something wrong with the 2010 version tchart.h, which I think is the missing of #ifndef...#define...#endif that was used in previous versions to avoid redefinition. Finally, I worked out a way to write a new header file tchartinc.h as below

#ifndef _Teechart_version_2010_
#define _Teechart_version_2010_
#include "tchart.h"
#endif

then instead of including tchart.h, I included tchartinc.h and the problem was solved.

I do hope you look into the codes and correct this error in the next release.

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Re: Urgent: Teechart 2010 tchart.h problem

Post by Pep » Mon Jan 31, 2011 10:13 am

Hello David,

ok, I'm glad to hear all is working fine.Thanks for the comment about the fix, we'll update the files for the next maintenance releaes which is planned to be out during this week.

Post Reply