Guides & Tutorials (beta)

Embedding License Information in Your Application

by Mike Palmatier Visual Basic 6 | Visual Basic .NET | C# .NET Created on 06/26/2008  |  Updated on 08/28/2024 0/5 ( 0 votes )

There are some situations that you may need to include the content of the LIC file in your control using the License property. You DO NOT include the actual LIC file. For example, if you develop in C# you will need to include the license information, if you are developing an ActiveX control for Internet Explorer, you will need to include the license information, or if you are creating an ActiveX control that uses\included a Codejock component you will need to include the license information. There might be other situations where this is needed as well.

The License property is located in the GlobalSettings class for each control. The code below illustrates how to use the License property for each control used.

You will need to provide the correct Product Id and Validate Code. This information can be found in the LIC file. The LIC file is located in the same location as the OCX file. By default, the location of the OCX and LIC file is the "..\Program Files\Codejock Software\ActiveX\Suite Pro ActiveX 2006 Q2\bin" for the Suite Pro installation. This code should be included before any controls are creates, for example, in thee Form_Initialize event of the main form for Visual Basic 6.0. For simplicity, the code below demonstrates how to embed the license information for the CommandBars only, you will need to do this for each control you use.

Private Sub Form_Initialize()

    CommandBarsGlobalSettings.License = "CommandBars Control Copyright (c) " & _
    "2003-2006 Codejock Software" & vbCrLf & "PRODUCT-ID: " & _
    "Codejock.CommandBars.ActiveX.v10.20" & vbCrLf & _
    "VALIDATE-CODE: XXX-XXX-XXX-XXX"

End Sub
public frmMain()
{
    XtremeCommandBars.CommandBarsGlobalSettingsClass CommandBarsSettings =
        new XtremeCommandBars.CommandBarsGlobalSettingsClass();

    CommandBarsSettings.License =
        "CommandBars Control Copyright (c) 2004-2006 " +
        "Codejock Software\r\n" +
        "PRODUCT-ID: Codejock.CommandBars.ActiveX.v10.20\r\n" +
        "VALIDATE-CODE: XXX-XXX-XXX-XXX";

    //
    // Required for Windows Form Designer support
    //
    InitializeComponent();

}
Public Sub New()
    MyBase.New()

    Dim CommandBarsSettings As _
        XtremeCommandBars.CommandBarsGlobalSettingsClass = _
        New XtremeCommandBars.CommandBarsGlobalSettingsClass

    CommandBarsSettings.License = "CommandBars Control Copyright (c) " + _
    "2003-2006 Codejock Software" + ControlChars.CrLf + "PRODUCT-ID: " + _
    "Codejock.CommandBars.ActiveX.v10.20" + ControlChars.CrLf + _
    "VALIDATE-CODE: XXX-XXX-XXX-XXX"

    'This call is required by the Windows Form Designer.
    InitializeComponent()

    'Add any initialization after the InitializeComponent() call

End Sub

User Comments

No comments yet, sign in to comment.

Secure Transactions

Online transactions are secure and protected.


Ssl seal 1
This site is protected by Trustwave's Trusted Commerce program
CompliAssure Secured

Money Back Guarantee

If you are not 100% happy with your purchase within 30 days, you can return it for any reason. Your satisfaction is our priority!


Satisfication Guarantee

Contact sales@codejock.com for more details.