PDA

View Full Version : "IC Imaging Control is not licensed to be used on your computer!"



zwzhang28
January 23, 2007, 17:24:21
Bought it.

Installed on just one machine.

Add a Form to one of our project (class libarary, dll).
Add a IC control.

Its constructor throw an Exception:
Message = "IC Imaging Control is not licensed to be used on your computer!"

Then how sould we unlock it???

Stefan Geissler
January 24, 2007, 08:13:05
Hi,

Could you please send the project to support@imagingcontrol.com to avoid misunderstandings?
I read you create a "classlibrary" project. In which programming language: C++, C#, VB?

Thank you in advance!

Stefan Geissler
January 25, 2007, 14:56:18
That is the solution: In the class library we have to change the LicenseContext temporarily. Thus we have to create an own class inherited from LicenseContext. This class will return the IC Imaging Control licensekey. It will be set to the LicenseManager.CurrentContext in the constructor.

First of all the LicenseContext inherited class MyLicenseContext. We have to implement four methods:


internal class MyLicenseContext : LicenseContext
{

public override LicenseUsageMode UsageMode
{
get
{
return LicenseUsageMode.Runtime;
}
}

public override string GetSavedLicenseKey(Type type, System.Reflection.Assembly resourceAssembly)
{
return "nnnnnnn"; // Insert your license key here!
}

public override Object GetService(Type type)
{
return null;
}

public override void SetSavedLicenseKey(Type type, string key)
{
}
}


Second: Usage. In our Classlibrary is a form named "ICForm". On the form we have dragged an IC Imaging Control. Now we have to enhance the constructor of the form as follows:


public ICForm()
{
LicenseContext SaveContext = LicenseManager.CurrentContext;
LicenseManager.CurrentContext = new MyLicenseContext();

InitializeComponent();
LicenseManager.CurrentContext = SaveContext;
}

This code saves the current license context, thus other licenses are not disturbed. Then we exchange the current license context with our own license context class. After doing so, the component is initialized (InitializeComponent();) Due to this task, IC Imaging Control is created and licensed with our own license context MyLicenseContext, that returns the correct license key.
After the initialization has been finished, we switch back to the application's license context.

Julian
March 24, 2007, 22:53:51
I don't understand this "solution" at all - the content of this thread starts off fine with someone complaining about exactly the symptoms I am getting and then suddenly Stefan you jump off into outer space. :mad: I am getting the "IC Imaging Control is not licensed to be used on your computer!" message when I copy the C# sample "Advaced Image Processing" project and try to rebuild under VS 2005. (The original sample runs ok) There is no mention anywhere within the project of LicenseContext or ICForm. Where is this additional code meant to go???? How do I get rid of this error message? :confused:

Stefan Geissler
March 26, 2007, 08:53:38
Julian,

In this thread, we two different issues. If IC Imaging Control is used from within a DLL or Classlibrary, Visual Studio does not call the licensing mechanism. But this is not your case. In your case you simply copied the project and got the same error message. The fast solution for this is to remove IC Imaging Control from the form, save the project and insert IC Imaging Control again. This seems to be an issue of Visual Studio.

The license context class is not your issue.

And I am not in outer space.

tgee
March 26, 2007, 13:58:59
I got this error recently. I set up the license context handling as noted on this page. This seemed to work fine.

However, later I tried to let a co-worker have the same VS project (with the licensing context fix included). I installed the Imaging Control TIS on his machine, and we plugged in the camera, but we got this message again.

I'm confused. We're not trying to steal a license, but I assumed that the development software license was really tied to the camera we bought, and that we'd be able to compile the same project on multiple machines.

I'm going to try to debug it more, but any help before that would be appreciated.

Thanks,

Tim

tgee
March 26, 2007, 14:37:01
I forgot to mention that my co-worker's PC is a 64-bit XP workstation, but we're trying to compile it as a 32-bit solution. Not sure if that affects anything.

Tim

tgee
March 26, 2007, 17:38:21
On my co-worker's 64-bit PC, I tried the Display Buffer example. I set the configuration to compile as x86. I removed and replaced the control as mentioned above. I also added the license context handling code to the example solution. I still get the license error message for the compile.

However, perhaps it's not just the license, because I also get a pop-up error in Visual Studio saying "Failed to query type library, Please reinstall the SDK". At one point, I did try reinstalling the SDK, and that didn't seem to help.

Tim

Stefan Geissler
March 27, 2007, 08:22:06
Hi Tim,

First of all, the license is not bound to the camera anyway. But in the license context sample is a very small part missing, thus it will only run correctly, if the the complete SDK is installed. On a retail installation, it wont work. To get the complete part, I would like you to send an email to support@imagingcontrol.com.
Nevertheless, the licensing context class in only necessary, if IC Imaging Control is used in a class library or if it is created dynamically. In other cases, e.g. all samples provided with it, the license context is generated automatically by Visual Studio and you do not have to take care about this.
The license mechanism implements the IC license due to the compilation of the program into the executable. This happens, if IC is used on a form. If IC is created dynamically, the Visual Studio compiler has no knowledge about its use and thus the license key is not embedded. In this case the license context must be created manually

At least I must surrender I have no experiences with Windows XP 64 or Windows Server 2003 64, but I suppose it may have some problems. The IC class library works fine on all systems.

Stefan Geissler
March 27, 2007, 16:05:23
Just an addition:

We found IC Imaging Control .NET component not working on 64 bit operating systems.

elha
June 1, 2007, 10:52:49
I´ve got the same license problem while trying to create ic project with SharpDevelop IDE (http://www.icsharpcode.net/) and found a solution which I will describe under http://www.theimagingsourceforums.com/showthread.php?t=318956 !

Hope that helps!
Lutz

Kurt
August 21, 2007, 14:34:42
Hi, I am having this problem when I embed the IC Imaging Control within another control which I then try to use in a program. If I use it directly on a form it works ok.

I tried the trick above, but am using the trial version and dont have a license key.

I wouldnt really like to embed the key string directly in the code even if I had one either as anyone could recover it and use it with the disassembler.

Is there any proper fix for this problem yet?

Thanks

Kurt