?
Solved

ActiveXForm!!! Cannot focus on a disabled or invisible window ???

Posted on 2003-03-05
11
Medium Priority
?
451 Views
Last Modified: 2010-04-04
hi,all experts

  <font size=5> i made an ActiveXForm to display word document on a web page. it contains an OLE container, everytime i enter my webpage(testXForm.asp) which contain this activexForm by clicking a link on another webpage(default.asp) for the first time,everything is ok! but i return to default.asp,and click this link to enter testXForm.asp again, error occurd: Cannot foucus a disabled or invisible window!  it is not the worst, and then when i clicked close button on the iexplorer's title, this error message box appeared again,and this time, i was not lucky enough, because i have to kill this thread by myself to make sure my OS can run other applications~~ , an unrelease winword.exe is still running ~~
  how could this happen?
  any suggestion would be appreciated~~!!
  thanx in advance!</font>

nickong
0
Comment
Question by:nickong
[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
11 Comments
 

Author Comment

by:nickong
ID: 8070346
do u need my souce code posting here??
0
 
LVL 9

Expert Comment

by:mocarts
ID: 8070382
check whether your code contains SetFocus method invocation. if so - before calling SetFocus check, whether it is possible, with CanFocus method of control. or use Form's ActiveControl property.

wbr, mo.
0
 

Author Comment

by:nickong
ID: 8071405
hi,mocarts

my code is here: i call setFocus in ActiveXForm's activate method. can i do so ??

procedure TNMWebWORD.ActiveFormActivate(Sender: TObject);
begin
  if nmg_Ole.Visible=true then
    nmg_Ole.SetFocus;
end;
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:nickong
ID: 8071462
and debug this program using showmessage(), i found such a fact: this procedure TNMWebWORD.ActiveFormActivate(Sender: TObject) was not called~~ why???
0
 
LVL 9

Expert Comment

by:mocarts
ID: 8071591
try this way (with CanFocus check).

procedure TNMWebWORD.ActiveFormActivate(Sender: TObject);
begin
 if nmg_Ole.Visible and nmg_Ole.CanFocus then
   nmg_Ole.SetFocus;
end;

it is possible that ShowMessage doesn't work in ActiveX interface.
mo.
0
 

Author Comment

by:nickong
ID: 8071690
i just try in ur way , and it dosent work~~

of course ShowMessage can work in ActiveX interface , i am using showMessage in my activex interface ~~ and when i open a doc successful , i show a message :"open successful"! it works pretty good~~!
0
 

Author Comment

by:nickong
ID: 8076312
can anybody help???
0
 

Author Comment

by:nickong
ID: 8077396
i solve this problem in this way , but it is not what i want~~

i just used javascript to alert a messagebox , before i enter this webpage , then my activeXform get focus automatically, can any experts tell me why ????

thanks
0
 

Expert Comment

by:CleanupPing
ID: 9316941
nickong:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 5

Expert Comment

by:snehanshu
ID: 10033473
Hi!
No comment has been added lately and this question is therefore classified abandoned.

If asker wishes to close the question, then refer to
http://www.experts-exchange.com/help/closing.jsp

Otherwise, I will leave a recommendation in the Cleanup topic area that this question is:

PAQ'd and pts refunded

Please leave any comments here within the next seven days. It is assumed that any participant not responding to this request is no longer interested in its final disposition.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

...Snehanshu
EE Cleanup Volunteer
0
 

Accepted Solution

by:
SpazMODic earned 0 total points
ID: 10087183
PAQed, with points refunded (78)

SpazMODic
EE Moderator
0

Featured Post

Industry Leaders: 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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

770 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