Modal Form can't open another Modal Form 
Author Message
 Modal Form can't open another Modal Form

Hi, All

I have a problem where I try to open a second Modal form from a form
which is Modal.  The code works fine under Windows NT 4.0, but when run
under windows 98 the second modal form will not open, and the first
modal form flickers for about 5 seconds, then the application terminates
with no error messages.

Any Suggestions?

I am running VB 5.0SP3, NT 4.0SP3, and Win98

I do not yet know if the problem occurs under Win95.

Regards,

Gary Harris



Fri, 23 Feb 2001 03:00:00 GMT  
 Modal Form can't open another Modal Form
I have a little additional information:  This problem only occurs if I
use the API SetWindowPos  in both form load events as follows:

   Public Declare Function SetWindowPos Lib "user32" (ByVal _
    hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, _
    ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags _
    As Long) As Long

    Public Const SWP_NOMOVE As Long = 2
    Public Const SWP_NOSIZE As Long = 1
    Public Const Flags As Long = SWP_NOMOVE Or SWP_NOSIZE
    Public Const HWND_TOPMOST As Long = -1
    Public Const HWND_NOTOPMOST As Long = -2
    Public gRES As Long

    gRES = SetWindowPos(Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, Flags)

Apparently, under Windows98 the two modal forms fight over who will be
on top, until VB fails!--but Win NT correctly resolves this issue.

My workaround was to make the parent form a non-modal form.

Regards,

Gary



Sat, 24 Feb 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ActiveX control on modal form give 'can't show non-modal form when modal form is displayed'

2. Problem with draw order after calling modal a modal from from a modal form

3. MODAL FORM & NON MODAL FORM

4. Unloading modal owner form also unloads modal form?

5. Modal Form with Modal form using Control?

6. MODAL FORM & NON MODAL FORM

7. MODAL FORM & NON MODAL FORM

8. non-modal form when a modal form is displayed

9. MODAL FORM & NON MODAL FORM

10. Loading a Modal Form from a Modal Form

11. Finding a modal form's calling form..

12. How Do I Change A Modal Form To Non-Modal

 

 
Powered by phpBB® Forum Software