在窗体上使用Web浏览器控件时出错 [英] Error Using Webbrowser Control on Form

查看:60
本文介绍了在窗体上使用Web浏览器控件时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在VB.Net项目中的表单上显示一些HTML。

我引用了COM WebBrowser控件,并将其实例放在我的

表格。


但是在Form_Load期间,我收到以下错误:


插入的代码生成器表单中的以下代码行(wbReport

是WebBrowser控件的

名称)


CType(我。 wbReport,System.ComponentModel.ISupportInitialize)。EndInit()


当表单被加载时,这行代码生成一个

InteropServices.ComException

(未知错误)。


这让我发疯,因为我下载了一个使用

WebBrowser的简单示例

VB.Net,它没有这个错误。


几点:

webbrowser控件托管于一个Tab控件,它位于一个表格上,即

是一个MDI孩子。

Cou这些中的任何一个都是罪魁祸首吗?


如何在VB.Net中的表单上显示HTML?


谢谢!

--- Selden McCabe

解决方案

嗨Selden


It那样做!我有完全相同的情况,它总是这样做我的b $ b我也是。这不是一个致命的错误,所以你的应用程序应该继续。


当你打电话给你时,你也会得到同样的非致命异常

AxWebBrowser1.Navigate (...)


我对你下载的没有这个

问题的样本感兴趣。你可以发布一个链接,因为我想看看它的作用是什么吗?b
不同,然后也许我可以为这两个

我们解决这个小难题。


Charles

" Selden McCabe" < SE ***** @ msn.com>在消息中写道

news:u%**************** @ TK2MSFTNGP12.phx.gbl ...

我'我试图在VB.Net项目中的表单上显示一些HTML。
我引用了COM WebBrowser控件,并将它的实例放在
我的表单上。
<但是在Form_Load期间,我收到以下错误:

代码生成器以
的形式插入以下代码行(wbReport是
名称of WebBrowser控件)

CType(Me.wbReport,System.ComponentModel.ISupportInitialize).EndInit()

当表单被加载时,这行代码生成一个< InteropServices.ComException
(未知错误)。

这让我发疯,因为我下载了一个使用
WebBrowser的简单例子。 > VB.Net,它没有这个错误。

有几点:
webbrowser控件托管在一个Tab控件上,该控件位于
的表单上MDI Chil d。
其中任何一个都可能是罪魁祸首吗?

如何在VB.Net中的表单上显示HTML?

谢谢!
- --Selden McCabe



嗨塞尔登


就是这样!我有完全相同的情况,它总是这样做我的b $ b我也是。这不是一个致命的错误,所以你的应用程序应该继续。


当你打电话给你时,你也会得到同样的非致命异常

AxWebBrowser1.Navigate (...)


我对你下载的没有这个

问题的样本感兴趣。你可以发布一个链接,因为我想看看它的作用是什么吗?b
不同,然后也许我可以为这两个

我们解决这个小难题。


Charles

" Selden McCabe" < SE ***** @ msn.com>在消息中写道

news:u%**************** @ TK2MSFTNGP12.phx.gbl ...

我'我试图在VB.Net项目中的表单上显示一些HTML。
我引用了COM WebBrowser控件,并将它的实例放在
我的表单上。
<但是在Form_Load期间,我收到以下错误:

代码生成器以
的形式插入以下代码行(wbReport是
名称of WebBrowser控件)

CType(Me.wbReport,System.ComponentModel.ISupportInitialize).EndInit()

当表单被加载时,这行代码生成一个< InteropServices.ComException
(未知错误)。

这让我发疯,因为我下载了一个使用
WebBrowser的简单例子。 > VB.Net,它没有这个错误。

有几点:
webbrowser控件托管在一个Tab控件上,该控件位于
的表单上MDI Chil d。
其中任何一个都可能是罪魁祸首吗?

如何在VB.Net中的表单上显示HTML?

谢谢!
- --Selden McCabe



嗨塞尔登


这是我认为MDI已知问题,看看这个新闻组中的消息

为此。

http://tinyurl.com/ywy7o


我希望这有帮助吗?


Cor

I''m trying to display some HTML on a form in a VB.Net project.
I''ve referenced the COM WebBrowser control, and put an instance of it on my
form.

But during the Form_Load, I''m getting the following error:

The code generator inserted the following line of code in the form (wbReport
is the
name of the WebBrowser control)

CType(Me.wbReport, System.ComponentModel.ISupportInitialize).EndInit( )

When the form gets loaded, this line of code generates a
InteropServices.ComException
("Unknown Error").

This is driving me crazy, since I downloaded a simple example of using the
WebBrowser in
VB.Net, and it works without this error.

A couple of points:
The webbrowser control is hosted on a Tab control, which is on a form that
is an MDI Child.
Could either of these be the culprit?

How can I display HTML on a form in VB.Net?

Thanks!
---Selden McCabe

解决方案

Hi Selden

It does that! I have exactly the same scenario and it has always done it to
me too. It is not a fatal error though, so your app should continue.

You will also get the same non-fatal exception when you call
AxWebBrowser1.Navigate(...)

I am interested in the sample you downloaded that does not have this
problem. Can you post a link as I would like to see what it does
differently, and then perhaps I can solve this little conundrum for both of
us.

Charles
"Selden McCabe" <se*****@msn.com> wrote in message
news:u%****************@TK2MSFTNGP12.phx.gbl...

I''m trying to display some HTML on a form in a VB.Net project.
I''ve referenced the COM WebBrowser control, and put an instance of it on my form.

But during the Form_Load, I''m getting the following error:

The code generator inserted the following line of code in the form (wbReport is the
name of the WebBrowser control)

CType(Me.wbReport, System.ComponentModel.ISupportInitialize).EndInit( )

When the form gets loaded, this line of code generates a
InteropServices.ComException
("Unknown Error").

This is driving me crazy, since I downloaded a simple example of using the
WebBrowser in
VB.Net, and it works without this error.

A couple of points:
The webbrowser control is hosted on a Tab control, which is on a form that
is an MDI Child.
Could either of these be the culprit?

How can I display HTML on a form in VB.Net?

Thanks!
---Selden McCabe



Hi Selden

It does that! I have exactly the same scenario and it has always done it to
me too. It is not a fatal error though, so your app should continue.

You will also get the same non-fatal exception when you call
AxWebBrowser1.Navigate(...)

I am interested in the sample you downloaded that does not have this
problem. Can you post a link as I would like to see what it does
differently, and then perhaps I can solve this little conundrum for both of
us.

Charles
"Selden McCabe" <se*****@msn.com> wrote in message
news:u%****************@TK2MSFTNGP12.phx.gbl...

I''m trying to display some HTML on a form in a VB.Net project.
I''ve referenced the COM WebBrowser control, and put an instance of it on my form.

But during the Form_Load, I''m getting the following error:

The code generator inserted the following line of code in the form (wbReport is the
name of the WebBrowser control)

CType(Me.wbReport, System.ComponentModel.ISupportInitialize).EndInit( )

When the form gets loaded, this line of code generates a
InteropServices.ComException
("Unknown Error").

This is driving me crazy, since I downloaded a simple example of using the
WebBrowser in
VB.Net, and it works without this error.

A couple of points:
The webbrowser control is hosted on a Tab control, which is on a form that
is an MDI Child.
Could either of these be the culprit?

How can I display HTML on a form in VB.Net?

Thanks!
---Selden McCabe



Hi Selden

That is I think a known problem with MDI, see the messages in this newsgroup
for this.

http://tinyurl.com/ywy7o

I hope this helps?

Cor


这篇关于在窗体上使用Web浏览器控件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆