You create a Microsoft Windows form (such as Form1), and
then you set the IsMdiContainer property of the form to True. You create a Microsoft Visual Basic 6.0 user control, and then
you add the user control to a Windows form (Form1) in Microsoft Visual Studio
.NET or in Microsoft Visual Studio 2005. If you create the Windows form as the parent form of another Windows form
that contains user controls, you display the child form, and then you run the
application on a computer that runs on the Microsoft Windows 98 operating
system, you receive the following error message:
System.InvalidOperationException: Unable to get the window handle
for the 'AxUserControl1' control. Windowless ActiveX controls are not
Note This article assumes that Visual Basic 6.0 and Microsoft .NET
Framework 1.0 are installed on your computer with Windows 98.
When you create a Windows form that contains user controls as
a multiple-document interface (MDI) child form, the Windows form always
destroys the child form, and then re-creates the child form. The Windows form
destroys all the controls on the child form, and then re-creates the controls.
However, the first user control is destroyed, but it is not re-created. The
second user control is not destroyed or re-created. Therefore, you receive the
error when you display the child form, because the first user control hwnd is
In Solution Explorer, right-click
WindowsApplication1, and then click
In the WindowsApplication1 property
pages, click to select Form2 in the Startup object list, and then
On the Build menu, click Build
Create a Setup1 folder on your
From the Bin subfolder in your
WindowsApplication1 project folder, copy the AxInterop.Project1.dll file, copy the
Interop.Project1.dll file, and copy the WindowsApplication1.exe file to the
From the location you where you saved the Visual Basic
6.0 user control that you created, copy the Project1.ocx file to the
Copy the Setup1 folder to a computer
that runs on the Windows 98 operating system.
On the computer that runs on the Windows 98 operating
system, click Start, and then click Run.
Type cmd in the
Open text box, and then press the ENTER key.
To register the control, run the following command at
the command prompt:
regsvr32 <project1.ocx file path on your local computer>
Right-click WindowsApplication1, click
Open, and then click Button1.
receive the exception mentioned in the "Symptoms" section of this