Page 1 of 1

Urgent: Teechart 2010 tchart.h problem

Posted: Fri Jan 21, 2011 7:12 am
by 9529132
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?

Re: Urgent: Teechart 2010 tchart.h problem

Posted: Sun Jan 23, 2011 2:52 pm
by 9529132
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.

Re: Urgent: Teechart 2010 tchart.h problem

Posted: Mon Jan 24, 2011 11:40 am
by 10050769
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,

Re: Urgent: Teechart 2010 tchart.h problem

Posted: Mon Jan 24, 2011 2:30 pm
by 9529132
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.

Re: Urgent: Teechart 2010 tchart.h problem

Posted: Tue Jan 25, 2011 12:44 pm
by 10050769
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,

Re: Urgent: Teechart 2010 tchart.h problem

Posted: Tue Jan 25, 2011 2:28 pm
by 9529132
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.

Re: Urgent: Teechart 2010 tchart.h problem

Posted: Thu Jan 27, 2011 1:28 pm
by 10050769
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,

Re: Urgent: Teechart 2010 tchart.h problem

Posted: Fri Jan 28, 2011 3:11 pm
by 9529132
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.

Re: Urgent: Teechart 2010 tchart.h problem

Posted: Fri Jan 28, 2011 3:46 pm
by 10050769
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,

Re: Urgent: Teechart 2010 tchart.h problem

Posted: Sat Jan 29, 2011 3:32 pm
by 9529132
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.

Re: Urgent: Teechart 2010 tchart.h problem

Posted: Mon Jan 31, 2011 10:13 am
by Pep
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.