Microsoft KB Archive/174686

= PRB: Error 371 or 404 Occurs When Using the Show Method =

Article ID: 174686

Article Last Modified on 5/13/2003

-

APPLIES TO


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

-



This article was previously published under Q174686



SYMPTOMS
When the MDI child form uses the Show method to open a form, you may receive the following error:

Run-time Error '371':

The specified object can't be used as an owner form for Show.

When the MDI child form uses the Show method to open an MDI Child form, you may receive the following error:

Run-time Error '404':

MDI child forms cannot be shown modally.



CAUSE
These errors occur if an MDI child form uses the Show method and specifies that it owns the form to display. An MDI child form cannot own another form.



STATUS
This behavior is by design.



MORE INFORMATION
While you can specify the owner of a form as one of the parameters in the Show method, you cannot designate an MDI Child form as an owner of another form.

Steps to Reproduce Problem
 Start a new Standard EXE project in Visual Basic. Form1 is created by default. Add a CommandButton to Form1. Add an MDI form and a second form to your project. Set the MDIChild Property of Form1 to True.

NOTE: To reproduce the error #5, set the MDIChild Property of Form2 to True as well.  Copy the following code to the Code window of Form1. Option Explicit

Private Sub Command1_Click Form2.Show vbModal, Me     End Sub  Press the F5 key to run the program. Click the CommandButton and the error occurs.</li></ol>

(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Arsenio Locsin, Microsoft Corporation

Keywords: kberrmsg kbprb KB174686

-

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

© Microsoft Corporation. All rights reserved.