Microsoft KB Archive/193335

= PRB: Error Loading Form With Reference to UserControl1.ctl =

Article ID: 193335

Article Last Modified on 5/13/2003

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q193335



SYMPTOMS
In a Visual Basic project, if you have a form that references a CTL file (such as UserControl1.ctl) instead of a compiled OCX, the reference will point to the specific project that contains the control only. If you add the UserControl and Form to a project of a different name later, the following error occurs:

Errors during loading. See .log for details.



CAUSE
The reference to the control is bound specifically to the project that the control resides in. When the form is added to another project, the reference becomes invalid.



STATUS
Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Behavior

 * 1) Create a new ActiveX Control project in Visual Basic. UserControl1 is created by default.
 * 2) Place a CommandButton on Usercontrol1.
 * 3) Save the control by selecting Save Usercontrol1 As from the File menu.
 * 4) Create a new Standard EXE project and name it Project1. Form1 is created by default.
 * 5) Add Usercontrol1.ctl to the new project by selecting Add User Control from the Project menu.
 * 6) Add an instance of Usercontrol1 to Form1 by dragging it from the toolbox to Form1.
 * 7) Save the Form by selecting Save Form1 As from the File menu.
 * 8) Create another new Standard EXE project and name it Project2.
 * 9) In Project Explorer, right-click on Form1 and select Remove Form1.frm.
 * 10) Add Usercontrol1.ctl, then Form1.frm subsequently to Project2. When Form1.frm is loading, the above error occurs.

NOTE: If you open up Form1.frm in Notepad, you will find a reference to Project1.Usercontrol1 Usercontrol11.

Additional query words: kbdss kbDSupport kbVBp kbVBp600 kbCtrl kbCtrlCreate

Keywords: kbprb KB193335

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.