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
Solved

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

Posted on 2004-04-25
6
979 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

809 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