Article ID: 193025 - Last Review: March 3, 2005 - Revision: 2.1 FIX: Cannot Dynamically Add a Non-Licensed MFC ControlThis article was previously published under Q193025 On This PageSYMPTOMS
When attempting to dynamically add an MFC ActiveX control to a Visual Basic
project, you may receive the following error message in the compiled
project:
Run-time error '747': No design-time license information is found for control 'XX.YY'. Contact the vendor for control 'XX.YY' to obtain a design-time license. CAUSE
When adding a new control to a Form or UserControl dynamically at run-time,
Visual Basic queries the control for the IClassFactory2 interface. This
interface is generally used by controls that require licensing. If the
control supports this interface, Visual Basic will then attempt to create
an instance of the control using the IClassFactory2::CreateInstanceLic
method, passing the developer-provided license string as a parameter. If no
license is required, an empty string is passed.
By default, all MFC ActiveX controls support the IClassFactory2 interface, even if the control does not require a design-time license. When Visual Basic makes the call to CreateInstanceLic, passing an empty string for the license, MFC returns the error CLASS_E_NOTLICENSED, indicating that the string passed is not a valid license key for this control. Visual Basic reports the error as an invalid or missing design-time license. RESOLUTION
There are currently two workarounds for this problem:
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base: 194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why (http://support.microsoft.com/kb/194022/EN-US/ ) 194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed (http://support.microsoft.com/kb/194295/EN-US/ ) MORE INFORMATIONSteps to Reproduce Behavior
REFERENCES
For additional information, please see the following articles in the
Microsoft Knowledge Base:
190670 (http://support.microsoft.com/kb/190670/EN-US/ ) HOWTO: Dynamically Add Controls to a Form with Visual Basic 6.0 188577 (http://support.microsoft.com/kb/188577/EN-US/ ) HOWTO: What is the Licenses Collection Used For? | Article Translations
|

Back to the top
