The first error is received if running a Visual Basic 6.0 project, the second applies to Visual Basic 5.0 projects.
- Do not pass forms or controls outside a project.
- Add the UserControl and the client projects to the same project group.
Steps to Reproduce BehaviorCreate the UserControl:
- Create a new UserControl project in Visual Basic, and name it TestCtl.
- Add a form to the project.
- Add the following code to the UserControl's code module:
Public Sub ShowForm(frm As Object)
Form1.Show vbModal, frm
- Compile the project and create TestCtl.ocx.
- Create a Standard EXE project in Visual Basic. Form1 is created by default.
- Add TestCtl.ocx to the ToolBox by selecting Components from the Tools menu and selecting the TestCtl control.
- Add a TestCtl to Form1.
- Add a CommandButton (Command1) to Form1.
- Add the following code to Form1's code module:
Private Sub Command1_Click()
- Press the F5 key to run the project. When you click Command1, one of the following messages is received:
Run-time error '373': "This interaction between compiled and design environment components is not supported." for a VB6 project.
Run-time error '-2147417848(80010108)': "Method 'xxx' failed" for a VB5 project.
Id. de artículo: 192129 - Última revisión: 05/13/2003 - Revisión: 1