<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : LicenseExcepti&#111;n in C#.Net</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : LicenseExcepti&#111;n in C#.Net]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 07:33:52 +0000</pubDate>
  <lastBuildDate>Mon, 01 Nov 2004 08:59:46 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=1332</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[LicenseExcepti&#111;n in C#.Net : Here&amp;#039;s the solution for C#...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1332&amp;PID=3777&amp;title=licenseexception-in-c-net#3777</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=260">Boyd</a><br /><strong>Subject:</strong> 1332<br /><strong>Posted:</strong> 01 November 2004 at 8:59am<br /><br /><P>Here's the solution for C# usage that Oleg gave me through my IssueTrak request.&nbsp; In the constructor for your main form, place the following code BEFORE the call to the 'InitializeComponents' method.</P><P>// Create Instance of Global Settings Class for CommandBars<BR>XtremeCommandBars.CommandBarsGlobalSettingsClass settings = new XtremeCommandBars.CommandBarsGlobalSettingsClass();<BR>// Now enter the first three lines of your license file<BR>// (Note carriage return line feed '\r\n' at the end of each line)<BR>settings.License = "CommandBars Control Copyright (c) 2003-2004 Codejock Software\r\n" +<BR>&nbsp; "PRODUCT-ID: XCB-ESD-ACTX-9500\r\n" +<BR>&nbsp; "VALIDATE-CODE: XXX-XXX-XXX-XXX";</P><P>This same technique must also be used for any other Codejock ActiveX controls.&nbsp; It also appears that this step is only necessary on the main form of the application.&nbsp; I have other classes stored in DLL's that also use the Codejock controls, and I was not required to set the licenses individually for each one.&nbsp; I guess they truly are Global Settings <IMG src="http://forum.codejock.com/smileys/smiley2.gif" border="0"></P><P>Thanks for the solution, Oleg!</P>]]>
   </description>
   <pubDate>Mon, 01 Nov 2004 08:59:46 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1332&amp;PID=3777&amp;title=licenseexception-in-c-net#3777</guid>
  </item> 
  <item>
   <title><![CDATA[LicenseExcepti&#111;n in C#.Net : I didn&amp;#039;t include the full...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1332&amp;PID=3745&amp;title=licenseexception-in-c-net#3745</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=260">Boyd</a><br /><strong>Subject:</strong> 1332<br /><strong>Posted:</strong> 28 October 2004 at 8:16am<br /><br /><P>I didn't include the full license in the following line, but I did include the line breaks in my application.</P><P>this.axCommandBars.GlobalSettings.License = "blah\r\nblah\r\nblah";</P><P>It appears that the problem I'm having is that you can't access the public members of CommandBars until after the control is fully initialized.&nbsp; Trying to access them before full initialization throws an 'InvalidActiveXStateException' error.&nbsp; However, when you finalize the control, it looks for the license.&nbsp; It appears I'm stuck!&nbsp; I can't set the license before initialization without throwing an error, and I can't initialize the control without a license.</P>]]>
   </description>
   <pubDate>Thu, 28 Oct 2004 08:16:37 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1332&amp;PID=3745&amp;title=licenseexception-in-c-net#3745</guid>
  </item> 
  <item>
   <title><![CDATA[LicenseExcepti&#111;n in C#.Net : I haven&amp;#039;t tried this in C#...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1332&amp;PID=3742&amp;title=licenseexception-in-c-net#3742</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=369">SuperMario</a><br /><strong>Subject:</strong> 1332<br /><strong>Posted:</strong> 28 October 2004 at 7:26am<br /><br />I haven't tried this in C# so I am just guessing, but in VB you need tomake sure that you hard code the line breaks from the .lic file.&nbsp;Maybe this will help, just use C# version of vbCrLf.<br><br>CommandBars.GlobalSettings.License = "Line1" &amp; vbCrLf &amp; "Line2" &amp; vbCrLf &amp; etc...<br>]]>
   </description>
   <pubDate>Thu, 28 Oct 2004 07:26:36 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1332&amp;PID=3742&amp;title=licenseexception-in-c-net#3742</guid>
  </item> 
  <item>
   <title><![CDATA[LicenseExcepti&#111;n in C#.Net : I have been working extensively...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1332&amp;PID=3721&amp;title=licenseexception-in-c-net#3721</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=260">Boyd</a><br /><strong>Subject:</strong> 1332<br /><strong>Posted:</strong> 27 October 2004 at 2:03pm<br /><br /><P>I have been working extensively on building a C# application that incorporates some of the Codejock ActiveX controls.&nbsp; Everything works fine when I run the application on my development machine.&nbsp; When I deploy the application to another machine, I get the following exception:</P><P>System.ComponentModel.LicenseException: You do not have a license to use this ActiveX control.<BR>&nbsp; at System.Windows.Forms.AxHost.CreateInstance()<BR>&nbsp; at System.Windows.Forms.AxHost.GetOcxCreate()<BR>&nbsp; at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)<BR>&nbsp; at System.Windows.Forms.AxHost.CreateHandle()<BR>&nbsp; at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)<BR>&nbsp; at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)<BR>&nbsp; at System.Windows.Forms.AsHost.EndInit()<BR>&nbsp; at MyApp.MainForm.InitializeComponent()<BR>&nbsp; at MyApp.MainForm..ctor()<BR>&nbsp; at MyApp.MainForm.Main()</P><P>This exeception is throw when the following line of my InitializeComponents&nbsp;method is executed (btw, this is all the code automatically generated by VS.Net editor from Designer where 'axCommandBars' is the name of my instance of CommandBars)</P><P> ((System.ComponentModel.ISupportInitialize)(this.axCommandBa rs)).EndInit();</P><P>My guess is that it's looking for a run-time license to the control that only existed on the development machine.&nbsp; With that in mind, I tried to use the 'CommandBars.GlobalSettings.License' property to set the text of my .LIC file.&nbsp; The problem is that I can't seem to get this property set without throwing an exception.&nbsp; Every time I try to set this property before the line that throws the LicenseException, I get an InvalidActiveXStateException.</P><P>Here's a snippet of the code I'm trying to use from the InitializeComponent() method:</P><P>System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeOf(MainForm));<BR>this.axCommandBars = new AxXtremeCommandBars.AxCommandBars();<BR> ((System.ComponentModel.ISupportInitialize)(this.axCommandBa rs)).BeginInit();<BR>this.SuspendLayout();<BR>// Standard Property Assignments for CommandBars like 'Enabled', 'Locatation', etc<BR>this.axCommandBars.GlobalSettings.License = "blah..blah..blah";<BR>this.axCommandBars.OcxState =  ((System.Windows.Forms.AxHost.State)(resources.GetObject("ax CommandBars.OcxState")));<BR> ((System.ComponentModel.ISupportInitialize)(this.axCommandBa rs)).EndInit(); // This line throws 'InvalidLicense' exception</P><P>Any ideas?&nbsp; I looked at the C# samples you provided, and I didn't find any example of specifying the license.&nbsp; Thank you in advance!</P>]]>
   </description>
   <pubDate>Wed, 27 Oct 2004 14:03:22 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1332&amp;PID=3721&amp;title=licenseexception-in-c-net#3721</guid>
  </item> 
 </channel>
</rss>