Solved

"Can't show non-modal form when modal..." vs Windows 2000

Posted on 2002-07-11
5
422 Views
Last Modified: 2012-05-04
I've written a VB6 program and it is installed on 35 various workstations.

I'm getting error 401 "Can't show non-modal form when modal form is displayed" in a couple of places, on two Window 2000 (Sp2) machines with the latest Windows updates ran on them. However, this error never occurs on the Windows98 & NT4 workstations. And also doesn't occur on 5 other Windows 2000 workstations (Sp2) that haven't had the Windows updates run.

Also on these two machines modal forms sometimes open frozen (as if Form.Enabled = False) where clicking on them does nothing but Escape/Alt+F4 do close the form.

I think the error could possibly be linked to a modal form that's hidden, but why work on the other 33 machines???

Assistance would be much appreciated
0
Comment
Question by:RobertEnglish
5 Comments
 
LVL 1

Expert Comment

by:PX
ID: 7145561
Hi,

This is something in ur code which one modal form is there and then the code want another modal form to display. to solve this problem, u must make sure that in ur code, there are no functions to call another modal form before u close the previous one. MODAL FORM ARE ALWAYS VISIBLE, so, there is no invisible possibility.

And this is not a problem of what version of windows (at least win32), or service pack.


PX
0
 
LVL 6

Expert Comment

by:MELeBlanc
ID: 7145917
Before we throw out the idea that it is not the OS...

Can you make the app freeze consistently on those W2K machines that are patched?  And if you use that same scenario that freezes it there.. when you perform these exact steps on an unpatched machine, does it not seize up/give errors?

-M
0
 
LVL 18

Expert Comment

by:mdougan
ID: 7146035
Often, in consistent behaviors between different OS or between different machines on the same OS are the result of a "timing" issue.  Not all event fire synchronosly.  It's possible on two different computers that on one computer the code executes a form load, and while that form is loading some other event code fires.  While, on another computer, the form might load so quickly that the other event fires after the form loads.

The behavior points to the likelyhood that you are not managing your forms properly.  The most common mistake is referencing properties or controls on a form that was not currently loaded.  In some cases, this will cause the form to be loaded, but not be visible.  You generally know when this is happening, because you close your main window and your application keeps running.  This happens a lot when people cut and paste code from one form to another.  Their might have been form name references in the code that was copied that never got changed.

Modal forms are another matter.  The only want to get a form to be modal is to explicitly show it as modal.  It should be fairly easy to search for all instances where you are showing a form modally, and then look within the code for that form and see if there are any instances where you are show another form.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8002322
Hi RobertEnglish,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Save as PAQ -- No Refund.

RobertEnglish, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 8095325
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now