问题标签 [moniker]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c++builder - 从 IPersistMoniker 加载 HTML 以将基本 URL 添加到相关链接
我正在尝试从 URL 加载 HTML,IPersistMoniker以添加相对 URL 基本路径,例如<img src="foo.jpg">从mypath/images/(或任何其他路径)加载。根据我发现的过程是(基于此示例):
- 实施
IMoniker实例,特别是GetDisplayName(提供相对链接的 URL)和BindToStorage(加载内容) QueryInterfaceTWebBrowser 文档的IID_IPersistMonikerCreateBindCtx(虽然不知道这是为了什么)- 使用
Load的方法IPersistMoniker来加载 HTML,传递IMoniker来自 (1)的CreateBindCtx实例和来自 (3)的实例
GetDisplayName在我的实例中确实被调用了,但是BindToStorage我应该将其传递IStream给实际 HTML 的位置从未被调用,因此文档总是显示为空白,未加载。HRESULTE_INVALIDARG用于调用Load. 我错过了什么?
IMoniker 实现(省略了一些内容):
加载内容: