孙杨游泳戴耳塞吗:我在打开网页时出现“could not obtain OLE control window handle”是怎么回事?

来源:百度文库 编辑:中科新闻网 时间:2024/05/01 21:55:06
此对话框关闭不了,只有重启。

“不可以获得对象连接与嵌入控制窗口”
建议你杀毒
重装IE

It seems that with Delphi 7, sometimes even the simplest application using a
TWebBrowser (by simplest meaning, just create form and from a TWebBrowser
onto it, shake and stir, run) will sometimes throw a

"Could not obtain OLE control window handle."

exception when starting the application.

The problem seems to appear sporadically only in certain builds. in other
words, i can do one build of the app and it will always fail. i can build
the app again sometime later, and it will work. Building the same
application in Delphi 6, it always works flawlessly. I know this sounds
nuts, but i'm seeing this exact behavior with several applications that use
TWebBrowser.

is anyone else seeing this? is there a known issue with Delphi 7's activex
control support? any thoughts would be greatly appreciated, as google
doesn't seem to come up with anything relevant to his very problem...

thanx,

--
marc hoffman (m...@elitedev.com)
elitedevelopments software
http://www.elitedev.com

"When two events occur simultaneously pertaining to the
same object of inquiry, one must always pay strict attention."

Maynard Philbrook
Mar 16 2003, 1:24 am show options

Newsgroups: borland.public.delphi.activex.controls.using
From: Maynard Philbrook <UseThis.jami...@mindspring.com> - Find messages by this author
Date: Sat, 15 Mar 2003 12:20:42 -0500
Local: Sun, Mar 16 2003 1:20 am
Subject: Re: D7: "Could not obtain OLE control window handle."
Reply to Author | Forward | Print | Individual Message | Show original | Report Abuse

No it does not sound nuts, it sounds like your dynamic creating an OLE/COM
using a window handle in the formcreate event that may not yet be valid.
i have seen that same condition here initiating the TWAIN_32.DLL which requires

a window handle and i do this in the formCreate, at times when testing the app
i start up and i get a NULL window handle in the FormCreate and i think its due
to the VCL using the IsWindow API call where its possible windows has not
marked it as a valid window yet due to possible thread lag else where when
starting your app and the VCL maybe passing back a NILL ..
that is my only guess at the time, what i have done is posted a user message
in the formCreate and thus it gets responded to after the form has done its
paint and initial start up.
for the time it has seem to take care of the problem of course you maybe having

some other issues.