Solved

'Cannot focus a disabled or invisible window' on Win98, not XP.

Posted on 2004-04-25
6
975 Views
Last Modified: 2010-04-05
Hi,

I use Delphi 7 Studio Enterprise on two machines (no network, just for comparison). The application I have runs on the XP machine flawlessly, but on the Windows 98 machine I keep getting "Project raised exception class EInvalidOperation with message 'Cannot focus a disabled or invisible window'. Process stopped. Use Step or Run to continue.

When I close the errormessage, the code that raised the exception turns out to be:

procedure TPropertyFrm.ShowContents(XObject : TObject);
begin
   IL_Property.Assign(MyProgramMain.IL_Nav);
   m_Closing := FALSE;

   if ED_Caption.Visible and ED_Caption.Enabled then
   try
      ActiveControl := ED_Caption;   //   <------- here is the hangup
   except
   end;
     
   DoDataExchange(FALSE);
end;

I compared the installation settings on both standalone machines and made the as similar as possible. Yet the problem stays.

What do you make of this?

Thanks,
Ron dW
0
Comment
Question by:Ron_de_Weijze
6 Comments
 
LVL 5

Accepted Solution

by:
rmaranhao earned 85 total points
ID: 10913338
The debug setting "Stop on Delphi Exceptions" is the same in both machines?
0
 
LVL 12

Assisted Solution

by:esoftbg
esoftbg earned 20 total points
ID: 10913447
I think it is impossible .exe file to raise an exception inside the construction
   try
   except
   end;
i guess
   if ED_Caption.Visible and ED_Caption.Enabled then
raises the exception
Place a breakpoint on this row
   IL_Property.Assign(MyProgramMain.IL_Nav);
and when the application stops there use F8-Step over.

May be the code needs to be:
   if Assigned(ED_Caption) then
   if ED_Caption.Visible and ED_Caption.Enabled then

I hope it will be helpful.
0
 
LVL 17

Assisted Solution

by:mokule
mokule earned 20 total points
ID: 10913573
Hi, better believe the message.

You checked
  if ED_Caption.Visible and ED_Caption.Enabled then
so it must be its parent problem or parent parent or ..
 
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:Ron_de_Weijze
ID: 10914083
The first comment was right. I had overlooked the 'Stop on Delphi exceptions' setting on the Win98 machine.

Thank you!
Ron dW
0
 
LVL 17

Expert Comment

by:mokule
ID: 10914104

But the problem, so hidden, remains :)
0
 

Author Comment

by:Ron_de_Weijze
ID: 10914573
That's right, but this will do for now. Thanks again.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

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

11 Experts available now in Live!

Get 1:1 Help Now