PRB: Error Loading Form With Reference to UserControl1.ctl
ID: Q193335
|
The information in this article applies to:
-
Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, version 6.0
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 <path to form>.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.
MORE INFORMATION
Steps to Reproduce Behavior
- Create a new ActiveX Control project in Visual Basic. UserControl1 is
created by default.
- Place a CommandButton on Usercontrol1.
- Save the control by selecting Save Usercontrol1 As from the File menu.
- Create a new Standard EXE project and name it Project1. Form1 is created
by default.
- Add Usercontrol1.ctl to the new project by selecting Add User Control
from the Project menu.
- Add an instance of Usercontrol1 to Form1 by dragging it from the toolbox
to Form1.
- Save the Form by selecting Save Form1 As from the File menu.
- Create another new Standard EXE project and name it Project2.
- In Project Explorer, right-click on Form1 and select Remove Form1.frm.
- 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 : kbGrpVB
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbprb