Plug-in License issue

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Freddie
Newbie
Newbie
Posts: 13
Joined: Thu Jun 25, 2009 12:00 am

Plug-in License issue

Post by Freddie » Tue Sep 22, 2009 9:08 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Plug-in License issue

Post by Narcís » Tue Sep 22, 2009 9:16 am

Hi Freddie,

Are you using the plugin license approach as described here?

Thanks in advance.
Best Regards,
Narcís Calvet / 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

Freddie
Newbie
Newbie
Posts: 13
Joined: Thu Jun 25, 2009 12:00 am

Re: Plug-in License issue

Post by Freddie » Tue Sep 22, 2009 10:27 am

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

Freddie
Newbie
Newbie
Posts: 13
Joined: Thu Jun 25, 2009 12:00 am

Re: Plug-in License issue

Post by Freddie » Wed Sep 23, 2009 5:35 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Plug-in License issue

Post by Narcís » Wed Sep 23, 2009 9:11 am

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).
Best Regards,
Narcís Calvet / 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

Freddie
Newbie
Newbie
Posts: 13
Joined: Thu Jun 25, 2009 12:00 am

Re: Plug-in License issue

Post by Freddie » Wed Sep 23, 2009 9:28 am

Thanks Narcis, i will be looking at the sample.
Is this valid for the WPF version aswell?
Im working with TeeChart.WPF.dll.

Thanks.

Freddie
Newbie
Newbie
Posts: 13
Joined: Thu Jun 25, 2009 12:00 am

Re: Plug-in License issue

Post by Freddie » Wed Sep 23, 2009 10:11 am

Sorry for double post. But here's my sample app. Could you please help me identify the goof-up.

Thanks,
Freddie
Attachments
License Issue.zip
(66.32 KiB) Downloaded 344 times

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Plug-in License issue

Post by Marc » Thu Sep 24, 2009 3:10 pm

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
Steema Support

Freddie
Newbie
Newbie
Posts: 13
Joined: Thu Jun 25, 2009 12:00 am

Re: Plug-in License issue

Post by Freddie » Fri Sep 25, 2009 4:22 am

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

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Plug-in License issue

Post by Marc » Fri Sep 25, 2009 11:48 am

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
Steema Support

Freddie
Newbie
Newbie
Posts: 13
Joined: Thu Jun 25, 2009 12:00 am

Re: Plug-in License issue

Post by Freddie » Fri Sep 25, 2009 12:13 pm

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.

Post Reply