passing TChart Activex as parameter in C#

TeeChart for ActiveX, COM and ASP
Post Reply
qanta
Newbie
Newbie
Posts: 7
Joined: Mon Apr 18, 2005 4:00 am

passing TChart Activex as parameter in C#

Post by qanta » Sun Mar 05, 2006 9:03 pm

Hello,

I am using Teechart ActiveX v7 in Visual C# . net (yes, I know it would be better to use the .net component, but this is not possible at the moment...).

I have created the TChart component on a form, and it shows up as an 'AxTeechart.AxTChart' object. I would like to pass this object to a class method I have created in another file, but as the class does not have a form, I seem to have only access to the 'TeeChart.TChart' type. (having added a reference to TeeChart and a 'using TChart' directive)

I have tried casting the 'AxTeeChart.AxTChart' object to a 'TeeChart.TChart' but the compiler won't accept this.

Any suggestions on how to allow me to pass the ActiveX as a parameter to my class method?

thanks

qanta
Newbie
Newbie
Posts: 7
Joined: Mon Apr 18, 2005 4:00 am

Post by qanta » Mon Mar 06, 2006 1:44 pm

OK nevermind, I've found out how to do this.

For anyone interested:

Visual C# .net creates a wrapper for any activex control dropped into a form. A new dll is created in the debug directory of the project called 'AxInterop.TeeChart.dll'. In the class you must add a reference to this file, AND to the TeeChart Activex. Then add these 2 using directives:

using AxTeeChart;
using TeeChart;

the class can then access the 'AxTeeChart.AxTChart' type.

Post Reply