Solved

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

Posted on 2002-07-11
5
421 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

744 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

17 Experts available now in Live!

Get 1:1 Help Now