This is a common issue, and is due to the fact that licensing information is not getting to the ActiveX control. Most likely, one of the following is the cause...
Cause #1: You are dynamically creating components at runtime.
If you are creating a component at runtime, you will need to embed the license key for each Iocomp ActiveX into your program. If you were to drop the control onto a form at design-time, the license key is embedded into the executable automatically by your development environment. If you wish to dynamically create the control at run-time, you will need to specify the control's license key. This is required as you are not allowed to distribute our development licenses to your end users per our software license agreement.
Visual C++ 6 Example (Disp Interface) //Add to the top of your form
#include "iplotx.h"
int IDiPlotX1 = 100; //make sure this is a unique value in your application
//Add somewhere in your initialization code
//usually in your OnInitDialog Event Handler
CRect ComponentRect;
CString LicenseString = "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}";
BSTR LicenseKey = LicenseString.AllocSysString();
ComponentRect.SetRect(10,10, 640, 380);
m_iPlotX1.Create("Plot", WS_VISIBLE, ComponentRect, this, IDiPlotX1, NULL, FALSE, LicenseKey);
Visual C++ 6 Example (iDispatch Interface) //Add the following to the top of each file that will use the iDispatch pointer variable
#import "iPlotLibrary.tlb" named_guids
#include "atlbase.h"
extern CComModule _Module;
//************************************************************
//Define a unique ID for the component, usually located in resource.h
//or you can use integer variables or other ways of storing these values
#define IDC_IPLOTX1 1001
//************************************************************
//Declare the component variable pointer,
//usually somewhere globally, such as in your form header file.
CComPtr<iPlotLibrary::IiPlotX> m_iPlotX1iDispatch;
//************************************************************
//Place the following code where you want to create the component
CWnd *m_Wnd=new CWnd;
IUnknown* m_iUnknown;
CRect ComponentRect;
ComponentRect.SetRect(10,10, 650, 490);
CString LicenseString = "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}";
BSTR LicenseKey = LicenseString.AllocSysString();
//The GUID below is the control guid of the iPlotX control.
//You can find a listing of these values in our Internet Explorer Examples
//at http://www.iocomp.com/examples/controlguids.htm
m_Wnd->CreateControl("{1791C036-8981-492A-BD28-F2331BC9B7C7}", NULL, WS_VISIBLE, ComponentRect, this, IDC_IPLOTX1, NULL, FALSE, LicenseKey);m_iUnknown = m_Wnd->GetControlUnknown();
//Setup Chart Properties
m_iUnknown->QueryInterface(__uuidof(iPlotLibrary::IiPlotX),(LPVOID*)&m_iPlotX1iDispatch);
m_iPlotX1iDispatch->AddChannel();
m_iPlotX1iDispatch->TitleText = "iDispatch Component";
Visual Basic 6 Example Private WithEvents extCtl As VBControlExtender Private Sub Form_Load()
Licenses.Add "isAnalogLibrary.iKnobX", "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
Set extCtl = Form1.Controls.Add("isAnalogLibrary.iKnobX", "iKnobX1")extCtl.Visible = True 'The control is invisible by default.
extCtl.Object.Position = 100 'This is how you access properties and methodsEnd Sub
Private Sub Form_Unload(Cancel As Integer)
Form1.Controls.Remove "iKnobX1"
Set extCtl = NothingEnd Sub
VB.NET Example Dim WithEvents axiAngularGaugeX1 As AxisAnalogLibrary.AxiAngularGaugeX 'This example shows creating the component when a button is clicked
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
axiAngularGaugeX1 = New AxisAnalogLibrary.AxiAngularGaugeX
Dim f As System.Reflection.FieldInfo
f = GetType(AxHost).GetField("licenseKey", _
Reflection.BindingFlags.NonPublic _
Or Reflection.BindingFlags.Instance)
f.SetValue(axiAngularGaugeX1, "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}")Controls.Add(axiAngularGaugeX1)
axiAngularGaugeX1.Left = 100
axiAngularGaugeX1.Top = 10
axiAngularGaugeX1.Width = 275
axiAngularGaugeX1.Height = 275
axiAngularGaugeX1.Show()
End Sub
C#.NET Example private AxisAnalogLibrary.AxiAngularGaugeX axiAngularGaugeX1; //This example shows creating the component when a button is clicked
private void button1_Click(object sender, System.EventArgs e)
{
axiAngularGaugeX1 = new AxisAnalogLibrary.AxiAngularGaugeX();
System.Reflection.FieldInfo f = typeof(AxHost).GetField("licenseKey", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
f.SetValue(axiAngularGaugeX1, "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}");
Controls.Add(axiAngularGaugeX1);axiAngularGaugeX1.Left = 100;
axiAngularGaugeX1.Top = 10;
axiAngularGaugeX1.Width = 275;
axiAngularGaugeX1.Height = 275;
axiAngularGaugeX1.Show();//To attach an event handler, set the event property as follows. For example,
private void axiAngularGaugeX1_OnPositionChange(object sender, EventArgs e)
//For the OnPosition Change event...
axiAngularGaugeX1.OnPositionChange += new EventHandler(axiAngularGaugeX1_OnPositionChange);
}
{
//Add OnPositionChange event handler code here
}
Note: you will need to substitute {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} above with the actual license key. See below for information on obtaining these keys from your system.
VB Special Note: In VB 6, if you add a control to the control pallet or reference the ocx file in the project, then you won't need to pass along the license key. Be sure that your VB 6 project isn't referencing the OCX either in your project options or in your component pallet, or VB 6 will not be able to add the license since it has already been added. If you need to dynamically create components at runtime and your project references the OCX, then skip the "Licenses.Add" method.
Obtaining License Keys for ActiveX Components Version 3.x, 2.0.8 SP4 or Higher
If you are using Iocomp Components Version 2.0.8 SP4 or higher, you can find the license keys for each Iocomp Component that you have purchased inside the Windows Registry at the following key...
HKEY_LOCAL_MACHINE\Software\Iocomp\Keys
Each license key is associated with its class name. For example, to get the license key for the iAngularGaugeX component, look for the value named "TiAngularGauge". (Notice the "T" in front on the class name and the absence of the trailing "X")
Obtaining License Keys for ActiveX Components Version 2.0.6 SP3 or Lower Versions
You can get the license key for the knob control used in this example by opening the LIC file (located in c:\program files\iocomp\components\activex, or wherever you installed your components) for the Analog Pack and using the key on the third line (e.g. {12345678-9012-3456-7890-123456789012}).
NOTE: You can use the Microsoft-supplied Licreqst.exe Tool to obtain the license key for any ActiveX component licensed on your development system: http://support.microsoft.com/default.aspx?scid=kb;EN-US;151771The following tables detail the order in which license keys can be found in each library's corresponding LIC file...
isAnalogLibrary isDigitalLibrary
- iAnalogDisplayX,
- iAnalogOutputX
- iKnobX
- iAngularGaugeX
- iLinearGaugeX
- iThermometerX
- iSliderX
- iLedBarX
- iLedSpiralX
- iOdometerX
- iSevenSegmentAnalogX
- iGradientX
- iLabelX
- iLedRectangleX
- iLedRoundX
- iSevenSegmentBinaryX
- iSevenSegmentCharacterX
- iSevenSegmentClockX
- iSevenSegmentHexadecimalX
- iSevenSegmentIntegerX
- iSwitchLedX
- iSwitchToggleX
- {Not Currently Used}
- iSwitchRotaryX
- iSwitchSliderX
iProfessionalLibrary iStripChartXControl
- iLedMatrixX
- iLedArrowX
- iSevenSegmentClockSMPTEX
- iObjectCanvasX
- iPanelX
- iLedDiamondX
- iSwitchQuadX
- iSwitchLeverX
- iSwitchRockerX
- iSwitchRocker3WayX
- iLogGaugeX
- iAngularLogGaugeX
- iTimersX
- iPieChartX
- iPercentBarX
- iRotationDisplayX
- iCompassX
- iSpectrumDisplayX
- iPhonePadX
- iThreadTimersX
- iDualCompassX
- iSlidingScaleX
- iSlidingCompassX
- {Not Currently Used}
- iKeyboardX
- iStripChartX
iPlotLibrary
- iPlotX
- iXYPlotX
Refer to the following Microsoft MSDN documents for additional assistance with licensing issues with ActiveX controls...
- Add Method (Controls Collection)
- Add Method (Licenses Collection)
- VBControlExtender Object
- HOWTO: What is the Licenses Collection Used For?
- ATL Composite Controls and Licensed ActiveX Controls
- SAMPLE: LicReqst Shows Requesting a License Key from an Object
- HOW TO: Dynamically Add ActiveX Controls that Require Run-Time Licenses in Visual Basic .NET
- HOW TO: Dynamically Add ActiveX Controls that Require Run-Time Licenses in C# .NET
For information on licensing ActiveX controls in Internet Explorer, review our Internet Explorer Example in our Examples Section.
WARNING!: under our license agreement, you are not allowed to distribute the LIC (license) files or the LIC registry keys to your end user's computers. License keys must be embedded in the program either automatically by the development environment or inside of your own source code.
WARNING!: if you are generating composite components with our controls (Components based off of our components), you may be running into a situation with our license agreement that may require a royalty agreement with Iocomp Software. Please contact Iocomp Support to discuss licensing issues regarding composite components and if royalties apply in you situation. Also See General FAQ #1.
Cause #2: Your end user is attempting to develop with the controls in an ActiveX development environment.
This generally happens if you allow your end user to make modifications to source code files, and they open up your development project or workspace. Please contact Iocomp Technical Support to discuss this issue.
Cause #3: You installed your finished product on your development system (Version 2.0.6 SP3 or Lower)
You installed your finished product on your development system, and can no longer develop with our ActiveX controls. When this happens, our ActiveX OCX files have usually been copied to and registered in the Windows System or System32 directory. To fix the problem, either copy your license files to the location where your installer registered our ActiveX controls (Note: if you do this and upgrade to a newer version of our components, the update components will be placed in our "C:\Program Files\Iocomp\Components\ActiveX" folder and re-registered. Please only keep one copy of our OCXs on your computer at any-one-time to prevent possible conflicts), or open our Setup Program from the Add/Remove control panel and select the REPAIR option to re-register the controls that are located with your license files.
Cause #4: Other possibilities
View other FAQs for other issues that may be causing this problem.
If you are using a beta version of our components, then you may be receiving a "Beta Expired" message after a certain date. To fix this, simply download the latest update or contact Iocomp Support for an update.
Copyright ©1998-2007 Iocomp Software Incorporated. Iocomp and the Iocomp Logo are registered trademarks of Iocomp Software Inc. All other trademarks are registered by their respective owners.