Page 1 of 1
Plug-in License issue
Posted: Tue Sep 22, 2009 9:08 am
by 15653576
Hello,
I have a composite application in WPF (.Net 3.5). Basically its a UI container which displays various plugins.
My plug-in dll is the one that uses TeeChart.
The problem is : when i try to execute my application on a machine that does not have tee chart installed on it, i get the license exception.
I tried using the contructor for plug-in license mentioned in the help files. But its doesn't work. If i add the teechart license to the license.licx of my
container dll, things work fine. But its something i cannot afford to do. Im wondering why the plug-in license contructor doesn't work.
Is there a special requirement for it? my container dll does not make calls to the teechart.
Thanks.
Freddie
Re: Plug-in License issue
Posted: Tue Sep 22, 2009 9:16 am
by narcis
Hi Freddie,
Are you using the plugin license approach as described
here?
Thanks in advance.
Re: Plug-in License issue
Posted: Tue Sep 22, 2009 10:27 am
by 15653576
Hi NarcĂs,
Yes, this is what i have been referring to in the TeeChart help file aswell.
But somehow, its just not working out for me.
Let me explain the scenario, its a composite application, meaning that i have a UI container which has a panel.
The UI container dynamically loads my dll containing the TeeChart, lets call it dummy.dll
This dummy.dll contains user control containing TeeChart. The moment i click on the button which causes this usercontrol from dummy.dll to be
displayed, i get a license exception.
Even if i implement the following :
Steema.TeeChart.TChart tempChart = new Steema.TeeChart.TChart(this);
tempChart = null;
InitializeComponent(); //
in my USER CONTROL'S CONTRUCTOR. It doesn't work. Is it the right way to go about it?
Im not sure, since the dll has already been loaded, its just that when i execute the command for displaying the user control , that's when the TeeChart is
created and i get the exception.
Loading of the module using Assembly.Load causes no issues.
Thanks for your help, much appreciated.
Freddie
Re: Plug-in License issue
Posted: Wed Sep 23, 2009 5:35 am
by 15653576
Hi,
I have implemented a sample app as per the help file.
It follows the exact steps given in the TeeChart help for executing a plugin dll.
I still get a license exception.
Could someone please help me with this as its very important for the upcomign release of our product.
Thanks.
Freddie
Re: Plug-in License issue
Posted: Wed Sep 23, 2009 9:11 am
by narcis
Hi Freddie,
The plugin technique works if your client application, the one housing the UI Panel, doesn't make reference to TeeChart directly, ie. that no button or like method in the app calls a TeeChart method or sets a TeeChart property. The plugin needs to be independant in that sense.
For a fully working example project please see:
http://www.teechart.net/files/public/su ... Steema.zip (you may need to change references to the location of the latest version of teechart.dll).
Re: Plug-in License issue
Posted: Wed Sep 23, 2009 9:28 am
by 15653576
Thanks Narcis, i will be looking at the sample.
Is this valid for the WPF version aswell?
Im working with TeeChart.WPF.dll.
Thanks.
Re: Plug-in License issue
Posted: Wed Sep 23, 2009 10:11 am
by 15653576
Sorry for double post. But here's my sample app. Could you please help me identify the goof-up.
Thanks,
Freddie
Re: Plug-in License issue
Posted: Thu Sep 24, 2009 3:10 pm
by Marc
Hello Freddie,
Your example is largely correctly setup. There's a couple of small changes you'll need to make. Here's an example of a constructor for the Usercontrol that permits the licensing to work correctly:
Code: Select all
public UserControl1()
{
Steema.TeeChart.WPF.Chart chart = new Steema.TeeChart.WPF.Chart(this);
chart = null;
InitializeComponent();
}
Note that the TeeChart constructor is taking the UserControl as argument, not the executing assembly. That allows the Usercontrol to ratify licensing independantly to that of the host application (that itself may not be aware of TeeChart).
Regards,
Marc Meumann
Re: Plug-in License issue
Posted: Fri Sep 25, 2009 4:22 am
by 15653576
Thanks for the response Marc.
Finally we have figured the problem, and its unbelievably silly.
The help file says :
Form:
namespace PluginWithTeeChart
{
public partial class FormWithChart : Form
{
public FormWithChart()
{
//discardable Chart forces License check
Steema.TeeChart.TChart tempChart = new Steema.TeeChart.TChart(this);
tempChart = null;
InitializeComponent(); //<---- Normal application code. Could run here various TeeCharts without need for overloaded constructor
}
}
}
And this is what we had been trying all these days !! However, it doesn't work, it works when i use 'Chart' instead of a 'TChart' class.
And since the help file says so, we had a completely frustrating time figuring this one out.
Regards.
Freddie
Re: Plug-in License issue
Posted: Fri Sep 25, 2009 11:48 am
by Marc
Hello Freddie,
Yes; TChart works if you are using a TChart, for a Steema.TeeChart.Chart use Steema.TeeChart.Chart and for WPF.Chart you should use a WPF.Chart (as indeed you did in the example you sent through). Besides that the key point to note would be that as mentioned a couple of posts back, that one should pass the Plugin's assembly to the Chart constructor (rather than the executing assembly).
Thanks for your feedback, we'll add a note to the documentation.
Regards!
Marc
Re: Plug-in License issue
Posted: Fri Sep 25, 2009 12:13 pm
by 15653576
Hello Marc,
Actually i did try to pass the plugin assembly as a parameter aswell, but i did not work.
I have read the documentation multiple times and tried multiple permutations and combinations, however, none of them
seemed to work with TChart class.
The Chart class works.
Thanks,
Freddie.