DOCUMENT:Q192693 29-JUL-1999 [foxpro] TITLE :BUG: License Error with ActiveX Control Added at Run-Time PRODUCT :Microsoft FoxPro PROD/VER:WINDOWS:6.0 OPER/SYS: KEYWORDS: ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual FoxPro for Windows, version 6.0 ------------------------------------------------------------------------------- SYMPTOMS ======== If you create an application that uses an ActiveX control that you add at run-time with syntax similar to the following: THISFORM.AddObject("myctrl","olecontrol","mscomctllib.listviewctrl.2") Then you build this application into an executable file, create a distribution with the Setup Wizard, and install your application on other computers, when you attempt to run code similar to the preceding code you receive an error like the following: Program Error OLE error code 0x80040112: Appropriate license for this class not found. CAUSE ===== A distribution created with the Visual FoxPro Setup Wizard only allows a run-time license, while the AddObject method requires a design time license. RESOLUTION ========== Add the control you want to use into a class that is saved in a Visual Class library or into a class created with the DEFINE CLASS command. Next, add an instance of the class at run-time instead of adding the control. Please see the MORE INFORMATION section for details. STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available. MORE INFORMATION ================ Steps to Reproduce Behavior --------------------------- The following example demonstrates using the DEFINE CLASS command to create a subclassed OleControl, then adds the subclassed OleControl at run-time. 1. Paste the following code into a program (.PRG) file: PUBLIC oform1 oform1=CREATEOBJECT("form1") oform1.Show READ EVENTS RETURN DEFINE CLASS form1 AS form AutoCenter = .T. cNextKey = "1_" Name = "Form1" Caption = "Treeview Demo Form" ADD OBJECT cmdExit AS commandbutton WITH ; Top = 204, ; Left = 276, ; Height = 27, ; Width = 84, ; Caption = "E\