锐英源软件
第一信赖

精通

英语

开源

擅长

开发

培训

胸怀四海 

第一信赖

当前位置:锐英源 / 英语翻译 开源技术 / csEXWB / LoadHTMLIntoBrowser with base url
服务方向
人工智能数据处理
人工智能培训
kaldi数据准备
小语种语音识别
语音识别标注
语音识别系统
语音识别转文字
kaldi开发技术服务
软件开发
运动控制卡上位机
机械加工软件
软件开发培训
Java 安卓移动开发
VC++
C#软件
汇编和破解
驱动开发
联系方式
固话:0371-63888850
手机:138-0381-0136
Q Q:396806883
微信:ryysoft

LoadHTMLIntoBrowser with base url


Could you show the base url that you are passing to the method. The url must be in the form of http://www.site.com as MSHTML does perform a check on the url before applying it.

你能演示要传递给方法的基本URL。该URL必须是http://www.site.com的形式因为MSHTML应用它之前会执行对URL检查。

The url was legitimate. I'm commenting about this because I have a similar problem in my application which hosts the WebBrowser control. If I don't use the control but work directly with mshtml by instantiating a new IHTMLDocument2, it works perfectly. My application isn't under the .NET environment and I discovered that there's a QueryInterface call on the IMoniker implementation requesting IAsyncMoniker object. After I implemented that in my application, everything worked perfectly.

网址是合法的。我在评论这一点,因为我也有类似的问题,其中我的应用程序承载WebBrowser控件。如果我不使用的控制,但通过实例化一个新的IHTMLDocument2与MSHTML直接工作,它是完美的作品。我的应用程序不是.NET环境下,我发现有对的IMoniker执行请求IAsyncMoniker对象QueryInterface调用。之后在我的应用程序,一切都工作正常。

Since I'm not a .NET developer I have no idea how to implement QueryInterface in C# but I'd appreciate if someone can try that out and let us know the results. btw: Can you confirm that this is currently a problem?

因为我不是一个.NET开发,我不知道如何在C#中实现QueryInterface,但如果有人可以尝试了这一点,并让我们知道结果,我会很感激。顺便说一句:你能否证实,这是目前的一个问题吗?

C# and VB hide IUnknown and IDispatch interfaces. QueryInerface calls are handled internally and are based on inherited interfaces. So if you want your class to return an object of type IServiceProvider during a call to QueryInterface, you inherit your class from the target interface.

C#和VB隐藏的IUnknown和IDispatch接口。 QueryInerface呼叫内部处理,并且基于遗传的接口。所以,如果你想你的类调用过程中的QueryInterface返回类型的IServiceProvider的对象,从目标接口继承类。

Adding IAsyncMoniker support:

添加IAsyncMoniker支持:

//Open GeneralClasses.cs, add the definition of IAsyncMoniker
[ComVisible(true), ComImport(),
Guid("79EAC9D3-BAF9-11CE-8C82-00AA004BA90B"),
InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IAsyncMoniker
{
}
//find LoadHTMLMoniker class, and add IAsyncMoniker to the inherited interfaces
class LoadHTMLMoniker : IMoniker, IAsyncMoniker

I neither can reproduce nor have received any bug reports in regard to the problem.

我既不能复制,也没有收到任何错误报告方面的问题。

You obviously know the rest but for other readers who wish to check this: Run the application, go to Tools->HTML Editor. In the form that opens select Open->File from the toolbar, select the local file. When the editor loads the file switch on the bottom left corner to Preview and you should now see that all the relative links are correct. You might first want to do that without the IAsyncMoniker fix to see that it uses about:blank as a prefix for the links.

芮然你已经知道了但其他读者谁愿意来检查这一点:运行该应用程序,进入工具 - > HTML编辑器。在打开选择打开 - >工具栏上的文件的形式,选择本地文件。当编辑器加载在左下角的文件切换到预览,你现在应该看到,所有的相对链接是正确的。你可能首先想要做的,如果没有IAsync名字对象固定地看到,它采用了约:空白作为链接的前缀。

I was able to reproduce the problem taking the steps you described. Indeed this is a bug and adding IAsyncMoniker interface solves the problem. I will include the fix in the next update.

我能够重现带你描述的步骤的问题。事实上,这是一个bug,添加IAsyncMoniker接口解决了这个问题。我将包括在下次更新中修复。

Apparently, when loading a file locally, MSHTML QI's the target class for IAsyncMoniker interface to determine if the class is capabale of Async operations. If IAsyncMoniker is not implemented, MSHTML ignores the BaseUrl.

显然,在加载文件本地时,为IAsyncMoniker接口服务的MSHTML QI是目标类,该接口来确定类是否能够异步操作。如果IAsyncMoniker不实现,MSHTML会忽略baseUrl。

友情链接
版权所有 Copyright(c)2004-2021 锐英源软件
公司注册号:410105000449586 豫ICP备08007559号 最佳分辨率 1024*768
地址:郑州大学北校区院(文化路97号院)内