?
Solved

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

Posted on 2004-04-25
6
Medium Priority
?
982 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 5

Accepted Solution

by:
rmaranhao earned 255 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 60 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 60 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month9 days, 21 hours left to enroll

762 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